rtpfunnel: fix extmap handling on accept-caps

Follow-up on 97d83056b3, only check
for intersection with the current srccaps when checking if a sinkpad
can accept caps.

I must have been lucky in my firefox testing then, and always entered
the code path with audio getting negotiated first, thus not failing
the is_subset check when srccaps had been negotiated as
application/x-rtp, and an accept-caps query was made for the video
caps with a defined extmap.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1384>
This commit is contained in:
Mathieu Duponchelle 2021-11-23 20:54:57 +01:00 committed by GStreamer Marge Bot
parent 423acef4d9
commit 4412198c05
2 changed files with 6 additions and 4 deletions

View file

@ -465,7 +465,7 @@ gst_rtp_funnel_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
gst_query_parse_accept_caps (query, &caps);
GST_OBJECT_LOCK (funnel);
result = gst_caps_is_subset (caps, funnel->srccaps);
result = gst_caps_can_intersect (caps, funnel->srccaps);
if (!result) {
GST_ERROR_OBJECT (pad,
"caps: %" GST_PTR_FORMAT " were not compatible with: %"

View file

@ -298,6 +298,8 @@ GST_END_TEST;
#define TWCC_EXTMAP_STR "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
#define BOGUS_EXTMAP_STR "http://www.ietf.org/id/bogus"
GST_START_TEST (rtpfunnel_twcc_caps)
{
GstHarness *h, *h0, *h1;
@ -321,10 +323,10 @@ GST_START_TEST (rtpfunnel_twcc_caps)
gst_caps_unref (caps);
gst_caps_unref (expected_caps);
/* now try and set a different extmap (4) on the other sinkpad,
and verify this does not work */
/* now try and set a different extmap for the same id on the other
* sinkpad, and verify this does not work */
gst_harness_set_src_caps_str (h1, "application/x-rtp, "
"ssrc=(uint)456, extmap-4=" TWCC_EXTMAP_STR "");
"ssrc=(uint)456, extmap-5=" BOGUS_EXTMAP_STR "");
caps = gst_pad_get_current_caps (GST_PAD_PEER (h1->srcpad));
fail_unless (caps == NULL);