diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-05-14 10:06:40 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-05-14 10:07:44 +0200 |
commit | 450a47c0a515cc51a1d9171f702940903ce11c34 (patch) | |
tree | a1e0ce3200efc474a766a8afd2223189a162383e | |
parent | 94b7ae776799a11351760752dc95853b08bb19d6 (diff) |
playback: Use subset checks instead of intersection
https://bugzilla.gnome.org/show_bug.cgi?id=700272
-rw-r--r-- | gst/playback/gstdecodebin2.c | 6 | ||||
-rw-r--r-- | gst/playback/gstplaybin2.c | 8 | ||||
-rw-r--r-- | gst/playback/gstsubtitleoverlay.c | 8 | ||||
-rw-r--r-- | gst/playback/gsturidecodebin.c | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 78da6d62a..d2697c6de 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -1373,7 +1373,7 @@ gst_decode_bin_autoplug_factories (GstElement * element, GstPad * pad, gst_decode_bin_update_factories_list (dbin); list = gst_element_factory_list_filter (dbin->factories, caps, GST_PAD_SINK, - FALSE); + TRUE); g_mutex_unlock (&dbin->factories_lock); result = g_value_array_new (g_list_length (list)); @@ -1563,7 +1563,7 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad, GstCaps *raw = gst_static_caps_get (&default_raw_caps); /* If the caps are raw, this just means we don't want to expose them */ - if (gst_caps_can_intersect (raw, caps)) { + if (gst_caps_is_subset (caps, raw)) { g_value_array_free (factories); gst_caps_unref (raw); gst_object_unref (dpad); @@ -2702,7 +2702,7 @@ are_final_caps (GstDecodeBin * dbin, GstCaps * caps) /* lock for getting the caps */ GST_OBJECT_LOCK (dbin); - res = gst_caps_can_intersect (dbin->caps, caps); + res = gst_caps_is_subset (caps, dbin->caps); GST_OBJECT_UNLOCK (dbin); GST_LOG_OBJECT (dbin, "Caps are %sfinal caps", res ? "" : "not "); diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 29cebdb32..1df566492 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3260,7 +3260,7 @@ _factory_can_sink_caps (GstElementFactory * factory, GstCaps * caps) GstCaps *templcaps = gst_static_caps_get (&templ->static_caps); if (!gst_caps_is_any (templcaps) - && gst_caps_can_intersect (templcaps, caps)) { + && gst_caps_is_subset (caps, templcaps)) { gst_caps_unref (templcaps); return TRUE; } @@ -3599,7 +3599,7 @@ autoplug_factories_cb (GstElement * decodebin, GstPad * pad, gst_play_bin_update_elements_list (playbin); factory_list = gst_element_factory_list_filter (playbin->elements, caps, GST_PAD_SINK, - FALSE); + TRUE); g_mutex_unlock (&playbin->elements_lock); GST_DEBUG_OBJECT (playbin, "found factories %p", factory_list); @@ -3954,9 +3954,9 @@ autoplug_select_cb (GstElement * decodebin, GstPad * pad, * any raw format. */ if ((isaudiodec && !(flags & GST_PLAY_FLAG_NATIVE_AUDIO) - && gst_caps_can_intersect (caps, raw_caps)) || (!isaudiodec + && gst_caps_is_subset (caps, raw_caps)) || (!isaudiodec && !(flags & GST_PLAY_FLAG_NATIVE_VIDEO) - && gst_caps_can_intersect (caps, raw_caps))) { + && gst_caps_is_subset (caps, raw_caps))) { compatible = gst_element_factory_can_src_any_caps (factory, raw_caps) || gst_element_factory_can_src_any_caps (factory, caps); diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index 70af107b2..64e9adefd 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -441,7 +441,7 @@ static gboolean check_factory_for_caps (GstElementFactory * factory, const GstCaps * caps) { GstCaps *fcaps = _get_sub_caps (factory); - gboolean ret = (fcaps) ? gst_caps_can_intersect (fcaps, caps) : FALSE; + gboolean ret = (fcaps) ? gst_caps_is_subset (caps, fcaps) : FALSE; if (fcaps) gst_caps_unref (fcaps); @@ -999,7 +999,7 @@ _link_renderer (GstSubtitleOverlay * self, GstElement * renderer, } else { /* No video pad */ GstCaps *allowed_caps, *video_caps = NULL; GstPad *video_peer; - gboolean can_intersect = FALSE; + gboolean is_subset = FALSE; video_peer = gst_pad_get_peer (self->video_sinkpad); if (video_peer) { @@ -1019,7 +1019,7 @@ _link_renderer (GstSubtitleOverlay * self, GstElement * renderer, gst_object_unref (sink); if (allowed_caps && video_caps) - can_intersect = gst_caps_can_intersect (allowed_caps, video_caps); + is_subset = gst_caps_is_subset (video_caps, allowed_caps); if (allowed_caps) gst_caps_unref (allowed_caps); @@ -1027,7 +1027,7 @@ _link_renderer (GstSubtitleOverlay * self, GstElement * renderer, if (video_caps) gst_caps_unref (video_caps); - if (G_UNLIKELY (!can_intersect)) { + if (G_UNLIKELY (!is_subset)) { GST_WARNING_OBJECT (self, "Renderer with custom caps is not " "compatible with video stream"); return FALSE; diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index 71edade34..b28461ee0 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -334,7 +334,7 @@ gst_uri_decode_bin_autoplug_factories (GstElement * element, GstPad * pad, gst_uri_decode_bin_update_factories_list (dec); list = gst_element_factory_list_filter (dec->factories, caps, GST_PAD_SINK, - FALSE); + TRUE); g_mutex_unlock (&dec->factories_lock); result = g_value_array_new (g_list_length (list)); |