[Spice-commits] 6 commits - configure.ac .gitlab-ci.yml meson.build meson_options.txt src/coroutine_gthread.c src/Makefile.am src/meson.build src/spice-audio.c tools/spicy.c vapi/Makefile.am vapi/meson.build vapi/spice-client-glib-2.0.deps

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 14 10:47:03 UTC 2019


 .gitlab-ci.yml                  |    3 --
 configure.ac                    |   35 +++++++++----------------
 meson.build                     |   34 +++++++-----------------
 meson_options.txt               |    8 -----
 src/Makefile.am                 |   11 ++------
 src/coroutine_gthread.c         |   55 ++++++++++++++++------------------------
 src/meson.build                 |    9 ++----
 src/spice-audio.c               |    4 --
 tools/spicy.c                   |   25 ++++--------------
 vapi/Makefile.am                |    2 +
 vapi/meson.build                |    4 +-
 vapi/spice-client-glib-2.0.deps |    1 
 12 files changed, 63 insertions(+), 128 deletions(-)

New commits:
commit 4c341a8eba1dc75bf4a4c577a595a1d5febeec2a
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jan 4 18:47:40 2019 +0400

    meson: switch usbredir option to auto feature
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Snir Sheriber <ssheribe at redhat.com>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 78b339e..e5a10a2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,7 +47,6 @@ makecheck_simple-meson:
   script:
   - meson build -Dauto_features=disabled
                 -Dgstvideo=false
-                -Dusbredir=false
                 -Ddbus=false || (cat build/meson-logs/meson-log.txt && exit 1)
   - ninja -C build
   - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
diff --git a/meson.build b/meson.build
index 4ade991..9ca579b 100644
--- a/meson.build
+++ b/meson.build
@@ -190,16 +190,11 @@ endif
 
 # usbredir
 spice_gtk_has_usbredir = false
-if get_option('usbredir')
-  deps = {'libusbredirparser-0.5': '>= 0.5',
-          'libusbredirhost' : '>= 0.4.2',
-          'libusb-1.0' : '>= 1.0.16'}
-
-  foreach dep, version : deps
-    usb_dep = dependency(dep, version : version)
-    spice_glib_deps += usb_dep
-  endforeach
-
+d1 = dependency('libusbredirparser-0.5', required : get_option('usbredir'))
+d2 = dependency('libusbredirhost', version : '>= 0.4.2', required : get_option('usbredir'))
+d3 = dependency('libusb-1.0', version : '>= 1.0.16', required : get_option('usbredir'))
+if d1.found() and d2.found() and d3.found()
+  spice_glib_deps += [d1, d2, d3]
   spice_gtk_config_data.set('USE_USBREDIR', '1')
   spice_gtk_has_usbredir = true
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 08eface..eaaf739 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,8 +21,7 @@ option('builtin-mjpeg',
     description : 'Enable the builtin mjpeg video decoder')
 
 option('usbredir',
-    type : 'boolean',
-    value : true,
+    type : 'feature',
     description : 'Enable usbredir support')
 
 option('polkit',
commit 9a4b3bcb55d87a7ce0096fac4ecc69d0b7dacf78
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sun Jan 6 00:15:00 2019 +0400

    build-sys: deprecate the pulseaudio backend
    
    The PulseAudio audio backend is still the default. However, it will be
    deprecated in favour of the GStreamer backend in a future release.
    
    Then PulseAudio will be disabled by default, and later on removed.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/configure.ac b/configure.ac
index fdd9788..85827b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -559,3 +559,6 @@ AC_MSG_NOTICE([
 
 ])
 SPICE_PRINT_MESSAGES
+
+AS_IF([test "x$enable_pulse" = "xyes"],
+  AC_MSG_WARN([PulseAudio backend is deprecated and will be removed in a future release]))
diff --git a/meson.build b/meson.build
index 4b49a24..4ade991 100644
--- a/meson.build
+++ b/meson.build
@@ -155,6 +155,7 @@ endif
 spice_gtk_has_pulse = false
 d = dependency('libpulse-mainloop-glib', required: get_option('pulse'))
 if d.found()
+  warning('PulseAudio backend is deprecated and will be removed in a future release')
   spice_glib_deps += d
   spice_gtk_config_data.set('HAVE_PULSE', '1')
   spice_gtk_has_pulse = true
commit 6a2319895164b6617b873e06c73a723ce2a708c0
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sat Jan 5 17:42:13 2019 +0400

    spicy: use SpiceSession::disconnected signal
    
    Let's not track channels ourself, but rely on the disconnected signal
    instead.
    
    This solves spicy hanging, when gstaudio is recording and the main
    loop is gone, so record channel is not finalized, and GStreamer
    locks.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/tools/spicy.c b/tools/spicy.c
index 06af15e..8a6d077 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -100,7 +100,6 @@ struct spice_connection {
     const char       *mouse_state;
     const char       *agent_state;
     gboolean         agent_connected;
-    int              channels;
     int              disconnecting;
 
     /* key: SpiceFileTransferTask, value: TransferTaskWidgets */
@@ -111,7 +110,8 @@ struct spice_connection {
 static spice_connection *connection_new(void);
 static void connection_connect(spice_connection *conn);
 static void connection_disconnect(spice_connection *conn);
-static void connection_destroy(spice_connection *conn);
+static void connection_destroy(SpiceSession *session,
+                               spice_connection *conn);
 static void usb_connect_failed(GObject               *object,
                                SpiceUsbDevice        *device,
                                GError                *error,
@@ -1726,7 +1726,6 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
     int id;
 
     g_object_get(channel, "channel-id", &id, NULL);
-    conn->channels++;
     SPICE_DEBUG("new channel (#%d)", id);
 
     if (SPICE_IS_MAIN_CHANNEL(channel)) {
@@ -1809,13 +1808,6 @@ static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer dat
         if (SPICE_PORT_CHANNEL(channel) == stdin_port)
             stdin_port = NULL;
     }
-
-    conn->channels--;
-    if (conn->channels > 0) {
-        return;
-    }
-
-    connection_destroy(conn);
 }
 
 static void migration_state(GObject *session,
@@ -1842,6 +1834,8 @@ static spice_connection *connection_new(void)
                      G_CALLBACK(channel_destroy), conn);
     g_signal_connect(conn->session, "notify::migration-state",
                      G_CALLBACK(migration_state), conn);
+    g_signal_connect(conn->session, "disconnected",
+                     G_CALLBACK(connection_destroy), conn);
 
     manager = spice_usb_device_manager_get(conn->session, NULL);
     if (manager) {
@@ -1873,7 +1867,8 @@ static void connection_disconnect(spice_connection *conn)
     spice_session_disconnect(conn->session);
 }
 
-static void connection_destroy(spice_connection *conn)
+static void connection_destroy(SpiceSession *session,
+                               spice_connection *conn)
 {
     g_object_unref(conn->session);
     g_hash_table_unref(conn->transfers);
commit 274ea2683bb1c9e88ce58e2640e84a47a8fcb939
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jan 4 17:38:28 2019 +0400

    coroutine-gthread: fix GThread deprecations
    
    spice-gtk requires glib 2.46.
    
    Modernize a bit coroutine-gthread.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/src/coroutine_gthread.c b/src/coroutine_gthread.c
index b0098fa..5eebc17 100644
--- a/src/coroutine_gthread.c
+++ b/src/coroutine_gthread.c
@@ -24,8 +24,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-static GCond *run_cond;
-static GMutex *run_lock;
+static GCond run_cond;
+static GMutex run_lock;;
 static struct coroutine *current;
 static struct coroutine leader;
 
@@ -37,19 +37,19 @@ static struct coroutine leader;
 
 static void coroutine_system_init(void)
 {
-	if (!g_thread_supported()) {
-	        CO_DEBUG("INIT");
-		g_thread_init(NULL);
+	if (current != NULL) {
+		return;
 	}
 
+	CO_DEBUG("INIT");
+
+	g_cond_init(&run_cond);
 
-	run_cond = g_cond_new();
-	run_lock = g_mutex_new();
 	CO_DEBUG("LOCK");
-	g_mutex_lock(run_lock);
+	g_mutex_lock(&run_lock);
 
-	/* The thread that creates the first coroutine is the system coroutine
-	 * so let's fill out a structure for it */
+	/* The thread that creates the first coroutine is the system
+	 * coroutine so let's fill out a structure for it */
 	leader.entry = NULL;
 	leader.release = NULL;
 	leader.stack_size = 0;
@@ -66,10 +66,10 @@ static gpointer coroutine_thread(gpointer opaque)
 {
 	struct coroutine *co = opaque;
 	CO_DEBUG("LOCK");
-	g_mutex_lock(run_lock);
+	g_mutex_lock(&run_lock);
 	while (!co->runnable) {
 		CO_DEBUG("WAIT");
-		g_cond_wait(run_cond, run_lock);
+		g_cond_wait(&run_cond, &run_lock);
 	}
 
 	CO_DEBUG("RUNNABLE");
@@ -79,28 +79,19 @@ static gpointer coroutine_thread(gpointer opaque)
 
 	co->caller->runnable = TRUE;
 	CO_DEBUG("BROADCAST");
-	g_cond_broadcast(run_cond);
+	g_cond_broadcast(&run_cond);
 	CO_DEBUG("UNLOCK");
-	g_mutex_unlock(run_lock);
+	g_mutex_unlock(&run_lock);
 
 	return NULL;
 }
 
 void coroutine_init(struct coroutine *co)
 {
-	GError *err = NULL;
-
-	if (run_cond == NULL)
-		coroutine_system_init();
-
+	coroutine_system_init();
 	CO_DEBUG("NEW");
-	co->thread = g_thread_create_full(coroutine_thread, co, co->stack_size,
-					  FALSE, TRUE,
-					  G_THREAD_PRIORITY_NORMAL,
-					  &err);
-	if (err != NULL)
-		g_error("g_thread_create_full() failed: %s", err->message);
-
+	co->thread = g_thread_new("coroutine-thread",
+				  coroutine_thread, co);
 	co->exited = 0;
 	co->runnable = FALSE;
 	co->caller = NULL;
@@ -118,14 +109,14 @@ void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)
 	to->data = arg;
 	to->caller = from;
 	CO_DEBUG("BROADCAST");
-	g_cond_broadcast(run_cond);
+	g_cond_broadcast(&run_cond);
 	CO_DEBUG("UNLOCK");
-	g_mutex_unlock(run_lock);
+	g_mutex_unlock(&run_lock);
 	CO_DEBUG("LOCK");
-	g_mutex_lock(run_lock);
+	g_mutex_lock(&run_lock);
 	while (!from->runnable) {
 	        CO_DEBUG("WAIT");
-		g_cond_wait(run_cond, run_lock);
+		g_cond_wait(&run_cond, &run_lock);
 	}
 	current = from;
 	to->caller = NULL;
@@ -136,9 +127,7 @@ void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)
 
 struct coroutine *coroutine_self(void)
 {
-	if (run_cond == NULL)
-		coroutine_system_init();
-
+	coroutine_system_init();
 	return current;
 }
 
commit daab027698a81cb0478c0452e16d52fc36cb7127
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Jan 3 20:30:08 2019 +0400

    build-sys: fix gir/vapi warnings with GstPipeline
    
    Add required dependency on gstreamer to fix unresolved GstPipeline
    type warning:
    
    <unknown>:: Warning: SpiceClientGLib: (Signal)gst-video-overlay: argument pipeline: Unresolved type: 'GstPipeline'
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Reviewed-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/Makefile.am b/src/Makefile.am
index f8335ca..d1de947 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -545,7 +545,7 @@ gtk_introspection_files =				\
 	$(NULL)
 
 SpiceClientGLib-2.0.gir: libspice-client-glib-2.0.la
-SpiceClientGLib_2_0_gir_INCLUDES = GObject-2.0 Gio-2.0
+SpiceClientGLib_2_0_gir_INCLUDES = GObject-2.0 Gio-2.0 GstBase-1.0
 SpiceClientGLib_2_0_gir_CFLAGS = $(SPICE_COMMON_CPPFLAGS)
 SpiceClientGLib_2_0_gir_LIBS = libspice-client-glib-2.0.la
 SpiceClientGLib_2_0_gir_FILES = $(glib_introspection_files)
diff --git a/src/meson.build b/src/meson.build
index 5754f1f..9f8999d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -211,7 +211,7 @@ spice_client_glib_gir = gnome.generate_gir(spice_client_glib_lib,
                                            export_packages : 'spice-client-glib-2.0',
                                            extra_args : ['--accept-unprefixed'],
                                            header : 'spice-client.h',
-                                           includes : ['GObject-2.0', 'Gio-2.0'],
+                                           includes : ['GObject-2.0', 'Gio-2.0', 'GstBase-1.0'],
                                            identifier_prefix : 'Spice',
                                            include_directories: spice_gtk_include,
                                            link_with : spice_client_glib_lib,
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 494ad83..3c6234d 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -27,6 +27,7 @@ spice-client-glib-2.0.vapi: $(top_builddir)/src/SpiceClientGLib-2.0.gir SpiceCli
 		--metadatadir=$(srcdir)		\
 		--library spice-client-glib-2.0	\
 		--pkg gio-2.0			\
+		--pkg gstreamer-1.0		\
 		$<
 
 spice-client-gtk-3.0.vapi: $(top_builddir)/src/SpiceClientGtk-3.0.gir spice-client-glib-2.0.vapi
@@ -34,6 +35,7 @@ spice-client-gtk-3.0.vapi: $(top_builddir)/src/SpiceClientGtk-3.0.gir spice-clie
 		--vapidir=$(builddir)					\
 		--girdir=$(top_builddir)/src				\
 		--pkg spice-client-glib-2.0				\
+		--pkg gstreamer-1.0					\
 		--pkg gtk+-3.0						\
 		--library spice-client-gtk-3.0				\
 		$<
diff --git a/vapi/meson.build b/vapi/meson.build
index de9adb9..2c4caa0 100644
--- a/vapi/meson.build
+++ b/vapi/meson.build
@@ -1,12 +1,12 @@
 if spice_gtk_has_vala
   gnome.generate_vapi('spice-client-glib-2.0',
                       install : true,
-                      packages : 'gio-2.0',
+                      packages : ['gio-2.0', 'gstreamer-1.0'],
                       sources : spice_client_glib_gir[0])
   if spice_gtk_has_gtk
     gnome.generate_vapi('spice-client-gtk-3.0',
                         install : true,
-                        packages : ['gtk+-3.0', 'spice-client-glib-2.0'],
+                        packages : ['gtk+-3.0', 'gstreamer-1.0', 'spice-client-glib-2.0'],
                         gir_dirs : join_paths(meson.build_root(), 'src'),
                         vapi_dirs : meson.current_build_dir(),
                         sources : spice_client_gtk_gir[0])
diff --git a/vapi/spice-client-glib-2.0.deps b/vapi/spice-client-glib-2.0.deps
index cd10dfd..64e63d2 100644
--- a/vapi/spice-client-glib-2.0.deps
+++ b/vapi/spice-client-glib-2.0.deps
@@ -1 +1,2 @@
 gio-2.0
+gstreamer-1.0
commit ac0e50f5e20227bf3d782ef9fdad742283e7fdeb
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Fri Jan 4 16:05:50 2019 +0400

    build-sys: drop gstaudio option, make GStreamer a requirement
    
    GStreamer is being increasingly used by spice-gtk. Let's make it a
    core requirement.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fd999d1..78b339e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,7 +32,6 @@ makecheck_simple:
   script:
   - ./autogen.sh --enable-static
         --enable-lz4=no
-        --enable-gstaudio=no
         --enable-gstvideo=no
         --enable-webdav=no
         --with-sasl=no
@@ -47,7 +46,6 @@ makecheck_simple:
 makecheck_simple-meson:
   script:
   - meson build -Dauto_features=disabled
-                -Dgstaudio=false
                 -Dgstvideo=false
                 -Dusbredir=false
                 -Ddbus=false || (cat build/meson-logs/meson-log.txt && exit 1)
diff --git a/configure.ac b/configure.ac
index 8c5c4d3..fdd9788 100644
--- a/configure.ac
+++ b/configure.ac
@@ -210,27 +210,16 @@ AS_IF([test "x$enable_pulse" != "xno"],
 ])
 AM_CONDITIONAL([HAVE_PULSE], [test "x$enable_pulse" = "xyes"])
 
-AC_ARG_ENABLE([gstaudio],
-  AS_HELP_STRING([--enable-gstaudio=@<:@yes/auto/no@:>@], [Enable the GStreamer 1.0 audio backend @<:@default=auto@:>@]),
-  [],
-  [enable_gstaudio="auto"])
-AS_IF([test "x$enable_gstaudio" != "xno"],
-      [SPICE_CHECK_GSTREAMER(GSTAUDIO, 1.0, [gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-audio-1.0],
-         [SPICE_CHECK_GSTREAMER_ELEMENTS($GST_INSPECT_1_0, [gst-plugins-base 1.0], [audioconvert audioresample appsink])
-          SPICE_CHECK_GSTREAMER_ELEMENTS($GST_INSPECT_1_0, [gst-plugins-good 1.0], [autoaudiosrc])
-          AS_IF([test x"$missing_gstreamer_elements" = "xyes"],
-                SPICE_WARNING([The GStreamer 1.0 audio backend can be built but may not work.]))
-         ],
-         [AS_IF([test "x$enable_gstaudio" = "xyes"],
-                AC_MSG_ERROR([GStreamer 1.0 audio requested but not found]))
-         ])
-      ], [have_gstaudio="no"]
-)
-AM_CONDITIONAL([HAVE_GSTAUDIO], [test "x$have_gstaudio" = "xyes"])
-
-AS_IF([test "x$enable_pulse$have_gstaudio" = "xnono"],
-      [SPICE_WARNING([No PulseAudio or GStreamer 1.0 audio decoder, audio will not be streamed])
-])
+SPICE_CHECK_GSTREAMER(GSTAUDIO, 1.0,
+    [gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-audio-1.0],
+    [SPICE_CHECK_GSTREAMER_ELEMENTS($GST_INSPECT_1_0,
+         [gst-plugins-base 1.0], [audioconvert audioresample appsink])
+     SPICE_CHECK_GSTREAMER_ELEMENTS($GST_INSPECT_1_0,
+         [gst-plugins-good 1.0], [autoaudiosrc])
+     AS_IF([test x"$missing_gstreamer_elements" = "xyes"],
+         SPICE_WARNING([The GStreamer 1.0 audio backend can be built but may not work.]))
+    ],
+    [AC_MSG_ERROR([Required GStreamer packages missing])])
 
 AC_ARG_ENABLE([gstvideo],
   AS_HELP_STRING([--enable-gstvideo=@<:@auto/yes/no@:>@],
@@ -558,7 +547,6 @@ AC_MSG_NOTICE([
         Gtk:                      ${with_gtk}
         Coroutine:                ${with_coroutine}
         PulseAudio:               ${enable_pulse}
-        GStreamer Audio:          ${have_gstaudio}
         GStreamer Video:          ${have_gstvideo}
         SASL support:             ${have_sasl}
         Smartcard support:        ${have_smartcard}
diff --git a/meson.build b/meson.build
index 3737768..4b49a24 100644
--- a/meson.build
+++ b/meson.build
@@ -160,25 +160,15 @@ if d.found()
   spice_gtk_has_pulse = true
 endif
 
-# gstaudio
-gst_base_deps = ['gstreamer-1.0', 'gstreamer-base-1.0', 'gstreamer-app-1.0']
-spice_gtk_has_gstaudio = false
-if get_option('gstaudio')
-  deps = gst_base_deps + ['gstreamer-audio-1.0']
-  foreach dep : deps
-    spice_glib_deps += dependency(dep)
-  endforeach
-  spice_gtk_config_data.set('HAVE_GSTAUDIO', '1')
-  spice_gtk_has_gstaudio = true
-endif
+deps = ['gstreamer-1.0', 'gstreamer-base-1.0', 'gstreamer-app-1.0', 'gstreamer-audio-1.0']
+foreach dep : deps
+  spice_glib_deps += dependency(dep)
+endforeach
 
 # gstvideo
 spice_gtk_has_gstvideo = false
 if get_option('gstvideo')
   deps = ['gstreamer-video-1.0']
-  if not spice_gtk_has_gstaudio
-    deps += gst_base_deps
-  endif
   foreach dep : deps
     spice_glib_deps += dependency(dep)
   endforeach
diff --git a/meson_options.txt b/meson_options.txt
index 32468b7..08eface 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,11 +10,6 @@ option('pulse',
     type : 'feature',
     description: 'Enable the PulseAudio backend')
 
-option('gstaudio',
-    type : 'boolean',
-    value : true,
-    description : 'Enable the GStreamer 1.0 audio backend')
-
 option('gstvideo',
     type : 'boolean',
     value : true,
diff --git a/src/Makefile.am b/src/Makefile.am
index b876530..f8335ca 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -217,6 +217,8 @@ libspice_client_glib_impl_la_SOURCES =			\
 	bio-gio.h					\
 	spice-audio.c					\
 	spice-audio-priv.h				\
+	spice-gstaudio.c				\
+	spice-gstaudio.h				\
 	spice-common.h					\
 	spice-util.c					\
 	spice-util-priv.h				\
@@ -318,13 +320,6 @@ libspice_client_glib_impl_la_SOURCES +=	\
 	$(NULL)
 endif
 
-if HAVE_GSTAUDIO
-libspice_client_glib_impl_la_SOURCES +=	\
-	spice-gstaudio.c		\
-	spice-gstaudio.h		\
-	$(NULL)
-endif
-
 if HAVE_BUILTIN_MJPEG
 libspice_client_glib_impl_la_SOURCES +=	\
 	channel-display-mjpeg.c		\
diff --git a/src/meson.build b/src/meson.build
index 73ddcc0..5754f1f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -110,6 +110,8 @@ spice_client_glib_sources = [
   'spice-file-transfer-task.c',
   'spice-file-transfer-task-priv.h',
   'spice-glib-main.c',
+  'spice-gstaudio.c',
+  'spice-gstaudio.h',
   'spice-option.h',
   'spice-session-priv.h',
   'spice-uri.c',
@@ -126,11 +128,6 @@ if spice_gtk_has_builtin_mjpeg
   spice_client_glib_sources += 'channel-display-mjpeg.c'
 endif
 
-if spice_gtk_has_gstaudio
-  spice_client_glib_sources += ['spice-gstaudio.c',
-                                'spice-gstaudio.h']
-endif
-
 if spice_gtk_has_gstvideo
   spice_client_glib_sources += 'channel-display-gst.c'
 endif
diff --git a/src/spice-audio.c b/src/spice-audio.c
index d2f0d92..daf62df 100644
--- a/src/spice-audio.c
+++ b/src/spice-audio.c
@@ -45,9 +45,7 @@
 #ifdef HAVE_PULSE
 #include "spice-pulse.h"
 #endif
-#ifdef HAVE_GSTAUDIO
 #include "spice-gstaudio.h"
-#endif
 
 G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(SpiceAudio, spice_audio, G_TYPE_OBJECT)
 
@@ -241,10 +239,8 @@ SpiceAudio *spice_audio_new_priv(SpiceSession *session, GMainContext *context,
 #ifdef HAVE_PULSE
     self = SPICE_AUDIO(spice_pulse_new(session, context, name));
 #endif
-#ifdef HAVE_GSTAUDIO
     if (!self)
         self = SPICE_AUDIO(spice_gstaudio_new(session, context, name));
-#endif
     if (!self)
         return NULL;
 
diff --git a/tools/spicy.c b/tools/spicy.c
index 060bbdc..06af15e 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -33,9 +33,7 @@
 #include "usb-device-widget.h"
 
 #include "spicy-connect.h"
-#if HAVE_GSTAUDIO || HAVE_GSTVIDEO
 #include <gst/gst.h>
-#endif
 
 typedef struct spice_connection spice_connection;
 
@@ -1997,9 +1995,7 @@ int main(int argc, char *argv[])
 
     /* parse opts */
     gtk_init(&argc, &argv);
-#if HAVE_GSTAUDIO || HAVE_GSTVIDEO
     gst_init(&argc, &argv);
-#endif
     context = g_option_context_new("- spice client test application");
     g_option_context_set_summary(context, "Gtk+ test client to connect to Spice servers.");
     g_option_context_set_description(context, "Report bugs to " PACKAGE_BUGREPORT ".");
@@ -2007,9 +2003,7 @@ int main(int argc, char *argv[])
     g_option_context_set_main_group(context, spice_cmdline_get_option_group());
     g_option_context_add_main_entries(context, cmd_entries, NULL);
     g_option_context_add_group(context, gtk_get_option_group(TRUE));
-#if HAVE_GSTAUDIO || HAVE_GSTVIDEO
     g_option_context_add_group(context, gst_init_get_option_group());
-#endif
     if (!g_option_context_parse (context, &argc, &argv, &error)) {
         g_print("option parsing failed: %s\n", error->message);
         exit(1);
@@ -2064,8 +2058,6 @@ int main(int argc, char *argv[])
     g_free(spicy_title);
 
     setup_terminal(true);
-#if HAVE_GSTAUDIO || HAVE_GSTVIDEO
     gst_deinit();
-#endif
     return 0;
 }


More information about the Spice-commits mailing list