playback: Use subset checks instead of intersection

https://bugzilla.gnome.org/show_bug.cgi?id=700272
This commit is contained in:
Sebastian Dröge 2013-05-14 10:06:40 +02:00
parent 94b7ae7767
commit 450a47c0a5
4 changed files with 12 additions and 12 deletions

View file

@ -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 ");

View file

@ -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);

View file

@ -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;

View file

@ -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));