From: Sebastian Dröge Date: Mon, 16 May 2011 13:19:35 +0000 (+0200) Subject: theora: Update for negotiation related API changes X-Git-Tag: 1.19.3~511^2~7662 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c276eec54e5b232965796f8c6ab2d3837c82f223;p=platform%2Fupstream%2Fgstreamer.git theora: Update for negotiation related API changes --- diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index 011ebd3..3a6dd16 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -252,7 +252,7 @@ static gboolean theora_enc_src_event (GstPad * pad, GstEvent * event); static GstFlowReturn theora_enc_chain (GstPad * pad, GstBuffer * buffer); static GstStateChangeReturn theora_enc_change_state (GstElement * element, GstStateChange transition); -static GstCaps *theora_enc_sink_getcaps (GstPad * pad); +static GstCaps *theora_enc_sink_getcaps (GstPad * pad, GstCaps * filter); static gboolean theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps); static void theora_enc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); @@ -578,7 +578,7 @@ theora_enc_get_supported_formats (void) } static GstCaps * -theora_enc_sink_getcaps (GstPad * pad) +theora_enc_sink_getcaps (GstPad * pad, GstCaps * filter) { GstCaps *caps; char *supported_formats, *caps_string; @@ -599,6 +599,15 @@ theora_enc_sink_getcaps (GstPad * pad) g_free (supported_formats); GST_DEBUG ("Supported caps: %" GST_PTR_FORMAT, caps); + if (filter) { + GstCaps *intersection; + + intersection = + gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = intersection; + } + return caps; } @@ -1194,7 +1203,7 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer) buffers = g_slist_reverse (buffers); /* mark buffers and put on caps */ - caps = gst_pad_get_caps (enc->srcpad); + caps = gst_pad_get_caps (enc->srcpad, NULL); caps = theora_set_header_on_caps (caps, buffers); GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps); gst_pad_set_caps (enc->srcpad, caps); diff --git a/ext/theora/gsttheoraparse.c b/ext/theora/gsttheoraparse.c index b1c57eb..07d5a4e 100644 --- a/ext/theora/gsttheoraparse.c +++ b/ext/theora/gsttheoraparse.c @@ -287,7 +287,7 @@ theora_parse_set_streamheader (GstTheoraParse * parse) g_assert (!parse->streamheader_received); - caps = gst_caps_make_writable (gst_pad_get_caps (parse->srcpad)); + caps = gst_caps_make_writable (gst_pad_get_caps (parse->srcpad, NULL)); theora_parse_set_header_on_caps (parse, caps); GST_DEBUG_OBJECT (parse, "here are the caps: %" GST_PTR_FORMAT, caps); gst_pad_set_caps (parse->srcpad, caps);