Commit 3010d1ec authored by Sebastian Dröge's avatar Sebastian Dröge

rtp: Filter with the filter caps in the payloader's getcaps

parent f94c4c00
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment