diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-05-20 16:49:03 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-05-20 16:49:55 +0200 |
commit | d3c9d84fdff9e411e345ce41508f8ed6813760fb (patch) | |
tree | 15823c86465690c3c7b1e1a3f2a614ef02651707 | |
parent | e428c10605560f652a1d84e2eced837ad08f262b (diff) |
vp8: Only enable the encoder or decoder if it's available in libvpx
Fixes bug #619172.
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | ext/vp8/gstvp8dec.c | 4 | ||||
-rw-r--r-- | ext/vp8/gstvp8enc.c | 4 | ||||
-rw-r--r-- | ext/vp8/plugin.c | 6 |
4 files changed, 22 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac index d03c40d74..92d8c735f 100644 --- a/configure.ac +++ b/configure.ac @@ -1481,12 +1481,24 @@ AG_GST_CHECK_FEATURE(ZBAR, [ZBar barcode detector], zbar, [ dnl *** vp8 *** translit(dnm, m, l) AM_CONDITIONAL(USE_VP8, vp8) AG_GST_CHECK_FEATURE(VP8, [VP8 decoder], vp8, [ + VPX_LIBS="" AG_GST_CHECK_LIBHEADER(VPX, vpx, vpx_codec_version, , - vpx/vpx_codec.h, - HAVE_VP8=yes - VPX_LIBS="-lvpx" - AC_SUBST(VPX_LIBS)) + vpx/vpx_codec.h, [ + HAVE_VP8_ENCODER=no + HAVE_VP8_DECODER=no + AC_CHECK_LIB(vpx, vpx_codec_vp8_cx_algo, [ + HAVE_VP8=yes + AC_DEFINE(HAVE_VP8_ENCODER, 1, [Defined if the VP8 encoder is available]) + VPX_LIBS="-lvpx" + ]) + AC_CHECK_LIB(vpx, vpx_codec_vp8_dx_algo, [ + HAVE_VP8=yes + AC_DEFINE(HAVE_VP8_DECODER, 1, [Defined if the VP8 decoder is available]) + VPX_LIBS="-lvpx" + ]) + ]) + AC_SUBST(VPX_LIBS) ]) else diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c index f54bcb418..1e059c835 100644 --- a/ext/vp8/gstvp8dec.c +++ b/ext/vp8/gstvp8dec.c @@ -44,7 +44,7 @@ #include "gstvp8utils.h" -#if CONFIG_VP8_DECODER +#ifdef HAVE_VP8_DECODER GST_DEBUG_CATEGORY_STATIC (gst_vp8dec_debug); #define GST_CAT_DEFAULT gst_vp8dec_debug @@ -532,4 +532,4 @@ gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame) return ret; } -#endif /* CONFIG_VP8_DECODER */ +#endif /* HAVE_VP8_DECODER */ diff --git a/ext/vp8/gstvp8enc.c b/ext/vp8/gstvp8enc.c index 04609789c..0d6224bad 100644 --- a/ext/vp8/gstvp8enc.c +++ b/ext/vp8/gstvp8enc.c @@ -45,7 +45,7 @@ #include "gstvp8utils.h" -#if CONFIG_VP8_ENCODER +#ifdef HAVE_VP8_ENCODER GST_DEBUG_CATEGORY_STATIC (gst_vp8enc_debug); #define GST_CAT_DEFAULT gst_vp8enc_debug @@ -844,4 +844,4 @@ gst_vp8_enc_sink_event (GstPad * pad, GstEvent * event) return ret; } -#endif /* CONFIG_VP8_ENCODER */ +#endif /* HAVE_VP8_ENCODER */ diff --git a/ext/vp8/plugin.c b/ext/vp8/plugin.c index 471c31093..4f4f194f9 100644 --- a/ext/vp8/plugin.c +++ b/ext/vp8/plugin.c @@ -25,20 +25,18 @@ #include <gst/gst.h> -#include <vpx/vpx_config.h> - GType gst_vp8_dec_get_type (void); GType gst_vp8_enc_get_type (void); static gboolean plugin_init (GstPlugin * plugin) { -#if CONFIG_VP8_DECODER +#ifdef HAVE_VP8_DECODER gst_element_register (plugin, "vp8dec", GST_RANK_PRIMARY, gst_vp8_dec_get_type ()); #endif -#if CONFIG_VP8_ENCODER +#ifdef HAVE_VP8_DECODER gst_element_register (plugin, "vp8enc", GST_RANK_PRIMARY, gst_vp8_enc_get_type ()); #endif |