From 4412198c0540a50f343d36530f7e3d4e9cdc74c8 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Tue, 23 Nov 2021 20:54:57 +0100 Subject: [PATCH] rtpfunnel: fix extmap handling on accept-caps Follow-up on 97d83056b315c56834eaa6776ae4c6a0848b5ef9, 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: --- .../gst-plugins-good/gst/rtpmanager/gstrtpfunnel.c | 2 +- .../gst-plugins-good/tests/check/elements/rtpfunnel.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpfunnel.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpfunnel.c index 092e7c3175..443ea87880 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpfunnel.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpfunnel.c @@ -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: %" diff --git a/subprojects/gst-plugins-good/tests/check/elements/rtpfunnel.c b/subprojects/gst-plugins-good/tests/check/elements/rtpfunnel.c index 5e7ee4523a..676127ca18 100644 --- a/subprojects/gst-plugins-good/tests/check/elements/rtpfunnel.c +++ b/subprojects/gst-plugins-good/tests/check/elements/rtpfunnel.c @@ -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);