From: Sebastian Dröge Date: Mon, 25 Jul 2016 10:34:02 +0000 (+0300) Subject: rtp: Filter with the filter caps in the payloader's getcaps X-Git-Tag: 1.19.3~509^2~2618 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3010d1ec2d8324fc28b2e396feb32175f62e7055;p=platform%2Fupstream%2Fgstreamer.git rtp: Filter with the filter caps in the payloader's getcaps --- diff --git a/gst/rtp/gstrtpbvpay.c b/gst/rtp/gstrtpbvpay.c index 9292681..e202015 100644 --- a/gst/rtp/gstrtpbvpay.c +++ b/gst/rtp/gstrtpbvpay.c @@ -217,6 +217,17 @@ gst_rtp_bv_pay_sink_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad, } gst_caps_unref (otherpadcaps); } + + if (filter) { + GstCaps *tmp; + + GST_DEBUG_OBJECT (rtppayload, "Intersect %" GST_PTR_FORMAT " and filter %" + GST_PTR_FORMAT, caps, filter); + tmp = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = tmp; + } + return caps; } diff --git a/gst/rtp/gstrtpceltpay.c b/gst/rtp/gstrtpceltpay.c index db2ebff..1d5287d 100644 --- a/gst/rtp/gstrtpceltpay.c +++ b/gst/rtp/gstrtpceltpay.c @@ -200,6 +200,16 @@ gst_rtp_celt_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad, gst_caps_unref (otherpadcaps); } + if (filter) { + GstCaps *tmp; + + GST_DEBUG_OBJECT (payload, "Intersect %" GST_PTR_FORMAT " and filter %" + GST_PTR_FORMAT, caps, filter); + tmp = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = tmp; + } + return caps; } diff --git a/gst/rtp/gstrtpg722pay.c b/gst/rtp/gstrtpg722pay.c index eb88c3c..c2fe88d 100644 --- a/gst/rtp/gstrtpg722pay.c +++ b/gst/rtp/gstrtpg722pay.c @@ -213,6 +213,17 @@ gst_rtp_g722_pay_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad, } gst_caps_unref (otherpadcaps); } + + if (filter) { + GstCaps *tmp; + + GST_DEBUG_OBJECT (rtppayload, "Intersect %" GST_PTR_FORMAT " and filter %" + GST_PTR_FORMAT, caps, filter); + tmp = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = tmp; + } + return caps; } diff --git a/gst/rtp/gstrtph263ppay.c b/gst/rtp/gstrtph263ppay.c index 844d3f7..176d7cc 100644 --- a/gst/rtp/gstrtph263ppay.c +++ b/gst/rtp/gstrtph263ppay.c @@ -254,8 +254,9 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad, if (!peercaps || gst_caps_is_any (peercaps)) { if (peercaps) gst_caps_unref (peercaps); - return + caps = gst_pad_get_pad_template_caps (GST_RTP_BASE_PAYLOAD_SINKPAD (payload)); + goto done; } /* We basically need to differentiate two use-cases here: One where there's @@ -264,9 +265,11 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad, * we want it to produce. The second case is simply payloader ! depayloader * where we are dealing with the depayloader's template caps. In this case * we should accept any input compatible with our sink template caps. */ - if (!gst_caps_is_fixed (peercaps)) - return + if (!gst_caps_is_fixed (peercaps)) { + caps = gst_pad_get_pad_template_caps (GST_RTP_BASE_PAYLOAD_SINKPAD (payload)); + goto done; + } templ = gst_pad_get_pad_template_caps (GST_RTP_BASE_PAYLOAD_SRCPAD (payload)); intersect = gst_caps_intersect (peercaps, templ); @@ -601,6 +604,18 @@ gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad, gst_caps_unref (intersect); +done: + + if (filter) { + GstCaps *tmp; + + GST_DEBUG_OBJECT (payload, "Intersect %" GST_PTR_FORMAT " and filter %" + GST_PTR_FORMAT, caps, filter); + tmp = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = tmp; + } + return caps; } diff --git a/gst/rtp/gstrtph265pay.c b/gst/rtp/gstrtph265pay.c index b63360e..10898b8 100644 --- a/gst/rtp/gstrtph265pay.c +++ b/gst/rtp/gstrtph265pay.c @@ -368,6 +368,16 @@ gst_rtp_h265_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad, done: + if (filter) { + GstCaps *tmp; + + GST_DEBUG_OBJECT (payload, "Intersect %" GST_PTR_FORMAT " and filter %" + GST_PTR_FORMAT, caps, filter); + tmp = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = tmp; + } + gst_caps_unref (template_caps); gst_caps_unref (allowed_caps); diff --git a/gst/rtp/gstrtpilbcpay.c b/gst/rtp/gstrtpilbcpay.c index 83161ff..cbc7d93 100644 --- a/gst/rtp/gstrtpilbcpay.c +++ b/gst/rtp/gstrtpilbcpay.c @@ -206,6 +206,17 @@ gst_rtp_ilbc_pay_sink_getcaps (GstRTPBasePayload * rtppayload, GstPad * pad, } gst_caps_unref (otherpadcaps); } + + if (filter) { + GstCaps *tmp; + + GST_DEBUG_OBJECT (rtppayload, "Intersect %" GST_PTR_FORMAT " and filter %" + GST_PTR_FORMAT, caps, filter); + tmp = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = tmp; + } + return caps; }