diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2007-01-05 18:32:03 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2007-01-05 18:32:03 +0000 |
commit | 1bf15564bf9ff6d5e1b70816e80aeae2d2c1e1a8 (patch) | |
tree | b7e28e5cf0e4d03d3a57b971ee2cbdbbb1395a94 | |
parent | 5b4a32581104b18d084ff97c65fa91afc653c487 (diff) | |
download | gst-plugins-bad-1bf15564bf9ff6d5e1b70816e80aeae2d2c1e1a8.tar.gz gst-plugins-bad-1bf15564bf9ff6d5e1b70816e80aeae2d2c1e1a8.tar.bz2 gst-plugins-bad-1bf15564bf9ff6d5e1b70816e80aeae2d2c1e1a8.zip |
Check for zlib and if available pass it explicitly to the linker when linking qtdemux. If not available (or --disable...
Original commit message from CVS:
* configure.ac:
* gst/qtdemux/Makefile.am:
* gst/qtdemux/qtdemux.c: (qtdemux_parse_moov):
Check for zlib and if available pass it explicitly to the linker
when linking qtdemux. If not available (or --disable-external has
been specified!), disable the bits in qtdemux that use it. Fixes
build on MingW (#392856).
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | gst/qtdemux/Makefile.am | 2 | ||||
-rw-r--r-- | gst/qtdemux/qtdemux.c | 49 |
4 files changed, 55 insertions, 18 deletions
@@ -1,3 +1,13 @@ +2007-01-05 Tim-Philipp Müller <tim at centricular dot net> + + * configure.ac: + * gst/qtdemux/Makefile.am: + * gst/qtdemux/qtdemux.c: (qtdemux_parse_moov): + Check for zlib and if available pass it explicitly to the linker + when linking qtdemux. If not available (or --disable-external has + been specified!), disable the bits in qtdemux that use it. Fixes + build on MingW (#392856). + 2007-01-05 Edward Hervey <edward@fluendo.com> * configure.ac: diff --git a/configure.ac b/configure.ac index 6735786f..e0c71400 100644 --- a/configure.ac +++ b/configure.ac @@ -821,6 +821,17 @@ GST_CHECK_FEATURE(DVB, [DVB Source], dvb, [ AC_CHECK_HEADER(linux/dvb/frontend.h, [HAVE_DVB="yes"], [HAVE_DVB="no"]) ]) +dnl *** qtdemux prefers to have zlib *** +translit(dnm, m, l) AM_CONDITIONAL(USE_ZLIB, true) +GST_CHECK_FEATURE(ZLIB, [zlib support for qtdemux],, [ + GST_CHECK_LIBHEADER(ZLIB, + z, uncompress,, zlib.h, [ + HAVE_ZLIB="yes" + ZLIB_LIBS="-lz" + AC_SUBST(ZLIB_LIBS) + ]) +]) + else dnl not building plugins with external dependencies, @@ -851,6 +862,7 @@ AM_CONDITIONAL(USE_THEORADEC, false) AM_CONDITIONAL(USE_XVID, false) AM_CONDITIONAL(USE_WAVPACK, false) AM_CONDITIONAL(USE_DVB, false) +AM_CONDITIONAL(USE_ZLIB, false) fi dnl of EXT plugins diff --git a/gst/qtdemux/Makefile.am b/gst/qtdemux/Makefile.am index f65f337e..1f480365 100644 --- a/gst/qtdemux/Makefile.am +++ b/gst/qtdemux/Makefile.am @@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgstqtdemux.la libgstqtdemux_la_CFLAGS = ${GST_CFLAGS} -libgstqtdemux_la_LIBADD = $(GST_BASE_LIBS) +libgstqtdemux_la_LIBADD = $(GST_BASE_LIBS) $(ZLIB_LIBS) libgstqtdemux_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS} libgstqtdemux_la_SOURCES = qtdemux.c diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 2b62f481..acf5861a 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -29,7 +29,10 @@ #include <stdlib.h> #include <string.h> -#include <zlib.h> + +#ifdef HAVE_ZLIB +# include <zlib.h> +#endif GST_DEBUG_CATEGORY_STATIC (qtdemux_debug); #define GST_CAT_DEFAULT qtdemux_debug @@ -2086,6 +2089,7 @@ static const QtNodeType qt_node_types[] = { }; static int n_qt_node_types = sizeof (qt_node_types) / sizeof (qt_node_types[0]); +#ifdef HAVE_ZLIB static void * qtdemux_zalloc (void *opaque, unsigned int items, unsigned int size) @@ -2135,6 +2139,8 @@ qtdemux_inflate (void *z_buffer, int z_length, int length) return buffer; } +#endif /* HAVE_ZLIB */ + static void qtdemux_parse_moov (GstQTDemux * qtdemux, guint8 * buffer, int length) { @@ -2147,32 +2153,41 @@ qtdemux_parse_moov (GstQTDemux * qtdemux, guint8 * buffer, int length) cmov = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_cmov); if (cmov) { + guint32 method; GNode *dcom; GNode *cmvd; dcom = qtdemux_tree_get_child_by_type (cmov, FOURCC_dcom); cmvd = qtdemux_tree_get_child_by_type (cmov, FOURCC_cmvd); - if (QTDEMUX_FOURCC_GET ((guint8 *) dcom->data + 8) == GST_MAKE_FOURCC ('z', - 'l', 'i', 'b')) { - int uncompressed_length; - int compressed_length; - guint8 *buf; + method = QTDEMUX_FOURCC_GET ((guint8 *) dcom->data + 8); + switch (method) { +#ifdef HAVE_ZLIB + case GST_MAKE_FOURCC ('z', 'l', 'i', 'b'):{ + int uncompressed_length; + int compressed_length; + guint8 *buf; - uncompressed_length = QTDEMUX_GUINT32_GET ((guint8 *) cmvd->data + 8); - compressed_length = QTDEMUX_GUINT32_GET ((guint8 *) cmvd->data + 4) - 12; - GST_LOG ("length = %d", uncompressed_length); + uncompressed_length = QTDEMUX_GUINT32_GET ((guint8 *) cmvd->data + 8); + compressed_length = + QTDEMUX_GUINT32_GET ((guint8 *) cmvd->data + 4) - 12; + GST_LOG ("length = %d", uncompressed_length); - buf = - (guint8 *) qtdemux_inflate ((guint8 *) cmvd->data + 12, - compressed_length, uncompressed_length); + buf = + (guint8 *) qtdemux_inflate ((guint8 *) cmvd->data + 12, + compressed_length, uncompressed_length); - qtdemux->moov_node_compressed = qtdemux->moov_node; - qtdemux->moov_node = g_node_new (buf); + qtdemux->moov_node_compressed = qtdemux->moov_node; + qtdemux->moov_node = g_node_new (buf); - qtdemux_parse (qtdemux, qtdemux->moov_node, buf, uncompressed_length); - } else { - GST_LOG ("unknown header compression type"); + qtdemux_parse (qtdemux, qtdemux->moov_node, buf, uncompressed_length); + break; + } +#endif /* HAVE_ZLIB */ + default: + GST_WARNING_OBJECT (qtdemux, "unknown or unhandled header compression " + "type %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (method)); + break; } } } |