From e428c10605560f652a1d84e2eced837ad08f262b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philip=20J=C3=A4genstedt?= Date: Thu, 20 May 2010 10:19:54 +0200 Subject: [PATCH] vp8: exlcude dec/enc based on CONFIG_VP8_DECODER/ENCODER This may not be very autotoolish, but works with libvpx in the state that libvpx is actually in. Moved the debug init to the elements themselves to minimize amount of #ifdefs --- ext/vp8/gstvp8dec.c | 8 +++++++- ext/vp8/gstvp8enc.c | 8 +++++++- ext/vp8/plugin.c | 13 +++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c index 60a93b7..f54bcb4 100644 --- a/ext/vp8/gstvp8dec.c +++ b/ext/vp8/gstvp8dec.c @@ -44,7 +44,9 @@ #include "gstvp8utils.h" -GST_DEBUG_CATEGORY (gst_vp8dec_debug); +#if CONFIG_VP8_DECODER + +GST_DEBUG_CATEGORY_STATIC (gst_vp8dec_debug); #define GST_CAT_DEFAULT gst_vp8dec_debug #define GST_TYPE_VP8_DEC \ @@ -223,6 +225,8 @@ gst_vp8_dec_class_init (GstVP8DecClass * klass) base_video_decoder_class->reset = gst_vp8_dec_reset; base_video_decoder_class->parse_data = gst_vp8_dec_parse_data; base_video_decoder_class->handle_frame = gst_vp8_dec_handle_frame; + + GST_DEBUG_CATEGORY_INIT (gst_vp8dec_debug, "vp8dec", 0, "VP8 Decoder"); } static void @@ -527,3 +531,5 @@ gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame) return ret; } + +#endif /* CONFIG_VP8_DECODER */ diff --git a/ext/vp8/gstvp8enc.c b/ext/vp8/gstvp8enc.c index 461af90..0460978 100644 --- a/ext/vp8/gstvp8enc.c +++ b/ext/vp8/gstvp8enc.c @@ -45,7 +45,9 @@ #include "gstvp8utils.h" -GST_DEBUG_CATEGORY (gst_vp8enc_debug); +#if CONFIG_VP8_ENCODER + +GST_DEBUG_CATEGORY_STATIC (gst_vp8enc_debug); #define GST_CAT_DEFAULT gst_vp8enc_debug #define GST_TYPE_VP8_ENC \ @@ -253,6 +255,8 @@ gst_vp8_enc_class_init (GstVP8EncClass * klass) "Speed", 0, 2, DEFAULT_SPEED, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + + GST_DEBUG_CATEGORY_INIT (gst_vp8enc_debug, "vp8enc", 0, "VP8 Encoder"); } static void @@ -839,3 +843,5 @@ gst_vp8_enc_sink_event (GstPad * pad, GstEvent * event) return ret; } + +#endif /* CONFIG_VP8_ENCODER */ diff --git a/ext/vp8/plugin.c b/ext/vp8/plugin.c index 97d7f38..471c310 100644 --- a/ext/vp8/plugin.c +++ b/ext/vp8/plugin.c @@ -25,22 +25,23 @@ #include +#include + GType gst_vp8_dec_get_type (void); GType gst_vp8_enc_get_type (void); -GST_DEBUG_CATEGORY_EXTERN (gst_vp8dec_debug); -GST_DEBUG_CATEGORY_EXTERN (gst_vp8enc_debug); - static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (gst_vp8dec_debug, "vp8dec", 0, "VP8 Decoder"); - GST_DEBUG_CATEGORY_INIT (gst_vp8enc_debug, "vp8enc", 0, "VP8 Encoder"); - +#if CONFIG_VP8_DECODER gst_element_register (plugin, "vp8dec", GST_RANK_PRIMARY, gst_vp8_dec_get_type ()); +#endif + +#if CONFIG_VP8_ENCODER gst_element_register (plugin, "vp8enc", GST_RANK_PRIMARY, gst_vp8_enc_get_type ()); +#endif return TRUE; } -- 2.7.4