playbin: use subset check instead of intersect
authorThiago Santos <thiagoss@osg.samsung.com>
Tue, 12 Jan 2016 14:31:50 +0000 (11:31 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Wed, 13 Jan 2016 18:29:17 +0000 (15:29 -0300)
Elements usually require that all fields on their caps are present
on the fixed caps they receive. Using intersection won't verify it,
resort to using is_subset() checks.

https://bugzilla.gnome.org/show_bug.cgi?id=760477

gst/playback/gstplaybin2.c

index 2ef2468..e3e79d3 100644 (file)
@@ -4451,7 +4451,7 @@ autoplug_continue_cb (GstElement * element, GstPad * pad, GstCaps * caps,
 
       sinkcaps = gst_pad_query_caps (sinkpad, NULL);
       if (!gst_caps_is_any (sinkcaps))
-        ret = !gst_caps_can_intersect (sinkcaps, caps);
+        ret = !gst_caps_is_subset (caps, sinkcaps);
       gst_caps_unref (sinkcaps);
       gst_object_unref (sinkpad);
     }
@@ -4482,7 +4482,7 @@ autoplug_continue_cb (GstElement * element, GstPad * pad, GstCaps * caps,
 
       sinkcaps = gst_pad_query_caps (sinkpad, NULL);
       if (!gst_caps_is_any (sinkcaps))
-        ret = !gst_caps_can_intersect (sinkcaps, caps);
+        ret = !gst_caps_is_subset (caps, sinkcaps);
       gst_caps_unref (sinkcaps);
       gst_object_unref (sinkpad);
     }
@@ -4500,7 +4500,7 @@ autoplug_continue_cb (GstElement * element, GstPad * pad, GstCaps * caps,
 
       sinkcaps = gst_pad_query_caps (sinkpad, NULL);
       if (!gst_caps_is_any (sinkcaps))
-        ret = !gst_caps_can_intersect (sinkcaps, caps);
+        ret = !gst_caps_is_subset (caps, sinkcaps);
       gst_caps_unref (sinkcaps);
       gst_object_unref (sinkpad);
     }
@@ -4530,7 +4530,7 @@ sink_accepts_caps (GstPlayBin * playbin, GstElement * sink, GstCaps * caps)
     sinkcaps = gst_pad_query_caps (sinkpad, NULL);
     /* Got the sink pad, now let's see if the element actually does accept the
      * caps that we have */
-    ret = gst_caps_can_intersect (sinkcaps, caps);
+    ret = gst_caps_is_subset (caps, sinkcaps);
     gst_caps_unref (sinkcaps);
     gst_object_unref (sinkpad);
   }