theoraenc: Update for video encoder API changes and propose video-meta for allocation
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 25 Apr 2012 10:43:28 +0000 (12:43 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 25 Apr 2012 11:19:11 +0000 (13:19 +0200)
ext/theora/gsttheoraenc.c

index 0f70ee6..92965dd 100644 (file)
@@ -65,6 +65,7 @@
 
 #include <gst/tag/tag.h>
 #include <gst/video/video.h>
+#include <gst/video/gstvideometa.h>
 
 #define GST_CAT_DEFAULT theoraenc_debug
 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
@@ -183,6 +184,8 @@ static GstFlowReturn theora_enc_handle_frame (GstVideoEncoder * enc,
 static GstFlowReturn theora_enc_pre_push (GstVideoEncoder * benc,
     GstVideoCodecFrame * frame);
 static GstFlowReturn theora_enc_finish (GstVideoEncoder * enc);
+static gboolean theora_enc_propose_allocation (GstVideoEncoder * encoder,
+    GstQuery * query);
 
 static GstCaps *theora_enc_getcaps (GstVideoEncoder * encoder,
     GstCaps * filter);
@@ -225,6 +228,8 @@ gst_theora_enc_class_init (GstTheoraEncClass * klass)
   gstvideo_encoder_class->pre_push = GST_DEBUG_FUNCPTR (theora_enc_pre_push);
   gstvideo_encoder_class->finish = GST_DEBUG_FUNCPTR (theora_enc_finish);
   gstvideo_encoder_class->getcaps = GST_DEBUG_FUNCPTR (theora_enc_getcaps);
+  gstvideo_encoder_class->propose_allocation =
+      GST_DEBUG_FUNCPTR (theora_enc_propose_allocation);
 
   /* general encoding stream options */
   g_object_class_install_property (gobject_class, PROP_BITRATE,
@@ -1038,6 +1043,15 @@ theora_enc_finish (GstVideoEncoder * benc)
   return TRUE;
 }
 
+static gboolean
+theora_enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query)
+{
+  gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE);
+
+  return GST_VIDEO_ENCODER_CLASS (parent_class)->propose_allocation (encoder,
+      query);
+}
+
 static void
 theora_enc_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec)