[Spice-devel] [PATCH v2 6/7] spice-gtk: Make it possible to disable support for the builtin MJPEG video decoder.
Francois Gouget
fgouget at codeweavers.com
Thu Aug 6 02:48:52 PDT 2015
This makes it possible to test the GStreamer video decoder with MJPEG streams.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
configure.ac | 8 ++++++++
src/Makefile.am | 7 ++++++-
src/channel-display.c | 2 ++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 003e351..1b1df3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -355,6 +355,14 @@ AM_CONDITIONAL([HAVE_GSTVIDEO], [test "x$have_gst_video" = "xyes"])]
AC_SUBST(GSTVIDEO_CFLAGS)
AC_SUBST(GSTVIDEO_LIBS)
+AC_ARG_ENABLE([builtin-mjpeg],
+ AS_HELP_STRING([--enable-builtin-mjpeg], [Enable the builtin mjpeg video decoder @<:@default=yes@:>@]),
+ [],
+ enable_builtin_mjpeg="yes")
+AS_IF([test "x$enable_builtin_mjpeg" = "xyes"],
+ [AC_DEFINE([WITH_BUILTIN_MJPEG], 1, [Use the builtin mjpeg decoder?])])
+AM_CONDITIONAL(WITH_BUILTIN_MJPEG, [test "x$enable_builtin_mjpeg" != "xno"])
+
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP(
diff --git a/src/Makefile.am b/src/Makefile.am
index 925c75f..e744ce9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -255,7 +255,6 @@ libspice_client_glib_2_0_la_SOURCES = \
channel-cursor.c \
channel-display.c \
channel-display-priv.h \
- channel-display-mjpeg.c \
channel-inputs.c \
channel-main.c \
channel-playback.c \
@@ -342,6 +341,12 @@ libspice_client_glib_2_0_la_SOURCES += \
$(NULL)
endif
+if WITH_BUILTIN_MJPEG
+libspice_client_glib_2_0_la_SOURCES += \
+ channel-display-mjpeg.c \
+ $(NULL)
+endif
+
if HAVE_GSTVIDEO
libspice_client_glib_2_0_la_SOURCES += \
channel-display-gst.c \
diff --git a/src/channel-display.c b/src/channel-display.c
index 7756d35..cb717d3 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1009,9 +1009,11 @@ static void display_handle_stream_create(SpiceChannel *channel, SpiceMsgIn *in)
display_update_stream_region(st);
switch (op->codec_type) {
+#ifdef WITH_BUILTIN_MJPEG
case SPICE_VIDEO_CODEC_TYPE_MJPEG:
st->video_decoder = create_mjpeg_decoder(op->codec_type, st);
break;
+#endif
default:
st->video_decoder = create_gstreamer_decoder(op->codec_type, st);
}
--
2.4.6
More information about the Spice-devel
mailing list