[MOVED FROM BAD 026/134] vp8: exlcude dec/enc based on CONFIG_VP8_DECODER/ENCODER
authorPhilip Jägenstedt <philipj@opera.com>
Thu, 20 May 2010 08:19:54 +0000 (10:19 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 16 Sep 2012 13:27:13 +0000 (15:27 +0200)
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
ext/vp8/gstvp8enc.c
ext/vp8/plugin.c

index 60a93b7..f54bcb4 100644 (file)
@@ -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 */
index 461af90..0460978 100644 (file)
@@ -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 */
index 97d7f38..471c310 100644 (file)
 
 #include <gst/gst.h>
 
+#include <vpx/vpx_config.h>
+
 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;
 }