diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-10-02 14:15:49 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-10-03 17:23:35 +0300 |
commit | f3cabe3cc39dcd5cd1dbe7b61b4bd58e07ad2119 (patch) | |
tree | 91f0f779bedc0e72e272f172478ca43450e31097 /ext/openh264 | |
parent | 2285cbaa45e56763c711e3c8faebc31d651169d1 (diff) | |
download | gstreamer-plugins-bad-f3cabe3cc39dcd5cd1dbe7b61b4bd58e07ad2119.tar.gz |
openh264enc: Add support for GstVideoMeta
This will allow upstream elements to work more efficiently.
Diffstat (limited to 'ext/openh264')
-rw-r--r-- | ext/openh264/gstopenh264enc.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/openh264/gstopenh264enc.cpp b/ext/openh264/gstopenh264enc.cpp index 6a66d39a8..143631530 100644 --- a/ext/openh264/gstopenh264enc.cpp +++ b/ext/openh264/gstopenh264enc.cpp @@ -100,6 +100,7 @@ static gboolean gst_openh264enc_stop(GstVideoEncoder *encoder); static gboolean gst_openh264enc_set_format(GstVideoEncoder *encoder, GstVideoCodecState *state); static GstFlowReturn gst_openh264enc_handle_frame(GstVideoEncoder *encoder, GstVideoCodecFrame *frame); +static gboolean gst_openh264enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query); static void gst_openh264enc_set_usage_type (GstOpenh264Enc *openh264enc, gint usage_type); static void gst_openh264enc_set_rate_control (GstOpenh264Enc *openh264enc, gint rc_mode); @@ -150,7 +151,7 @@ struct _GstOpenh264EncPrivate static GstStaticPadTemplate gst_openh264enc_sink_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS(GST_VIDEO_CAPS_MAKE("{ I420 }")) + GST_STATIC_CAPS(GST_VIDEO_CAPS_MAKE("I420")) ); static GstStaticPadTemplate gst_openh264enc_src_template = GST_STATIC_PAD_TEMPLATE("src", @@ -188,6 +189,7 @@ static void gst_openh264enc_class_init(GstOpenh264EncClass *klass) video_encoder_class->stop = GST_DEBUG_FUNCPTR(gst_openh264enc_stop); video_encoder_class->set_format = GST_DEBUG_FUNCPTR(gst_openh264enc_set_format); video_encoder_class->handle_frame = GST_DEBUG_FUNCPTR(gst_openh264enc_handle_frame); + video_encoder_class->propose_allocation = GST_DEBUG_FUNCPTR(gst_openh264enc_propose_allocation); /* define properties */ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_USAGE_TYPE, @@ -550,6 +552,14 @@ static gboolean gst_openh264enc_set_format(GstVideoEncoder *encoder, GstVideoCod return gst_video_encoder_negotiate (encoder); } +static gboolean gst_openh264enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query) +{ + gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL); + + return GST_VIDEO_ENCODER_CLASS (gst_openh264enc_parent_class)->propose_allocation (encoder, + query); +} + static GstFlowReturn gst_openh264enc_handle_frame(GstVideoEncoder *encoder, GstVideoCodecFrame *frame) { GstOpenh264Enc *openh264enc = GST_OPENH264ENC(encoder); |