rtpfunnel: fix extmap handling on accept-caps
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 23 Nov 2021 19:54:57 +0000 (20:54 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 23 Nov 2021 20:26:30 +0000 (20:26 +0000)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1384>

subprojects/gst-plugins-good/gst/rtpmanager/gstrtpfunnel.c
subprojects/gst-plugins-good/tests/check/elements/rtpfunnel.c

index 092e7c3..443ea87 100644 (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: %"
index 5e7ee45..676127c 100644 (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);