rtph264pay: Intersect with filter caps in getcaps function.
authorJan Schmidt <thaytan@noraisin.net>
Wed, 29 Jun 2016 15:56:41 +0000 (01:56 +1000)
committerJan Schmidt <jan@centricular.com>
Tue, 19 Jul 2016 14:31:59 +0000 (00:31 +1000)
Always intersect with the filter caps in the getcaps function
to make sure we return a subset of what was requested.

Other payloaders also have this problem and need fixing
in future commits.

gst/rtp/gstrtph264pay.c

index f5167da..808eb1d 100644 (file)
@@ -340,6 +340,13 @@ gst_rtp_h264_pay_getcaps (GstRTPBasePayload * payload, GstPad * pad,
   caps = icaps;
 
 done:
+  if (filter) {
+    GST_DEBUG_OBJECT (payload, "Intersect %" GST_PTR_FORMAT " and filter %"
+        GST_PTR_FORMAT, caps, filter);
+    icaps = gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+    gst_caps_unref (caps);
+    caps = icaps;
+  }
 
   gst_caps_unref (template_caps);
   gst_caps_unref (allowed_caps);