playbin: Ignore caps from audio/video sink factories if there are fixed sinks already

This commit is contained in:
Sebastian Dröge 2013-03-30 12:15:38 +01:00
parent 5d499f1e14
commit 7f78f7f9e3

View file

@ -3649,6 +3649,7 @@ autoplug_query_cb (GstElement * uridecodebin, GstPad * pad, GstQuery * query,
GstPad *sinkpad = NULL; GstPad *sinkpad = NULL;
GValueArray *factories; GValueArray *factories;
gint i, n; gint i, n;
gboolean have_audio_sink = FALSE, have_video_sink = FALSE;
if (GST_QUERY_TYPE (query) != GST_QUERY_CAPS) if (GST_QUERY_TYPE (query) != GST_QUERY_CAPS)
return FALSE; return FALSE;
@ -3714,6 +3715,7 @@ autoplug_query_cb (GstElement * uridecodebin, GstPad * pad, GstQuery * query,
} }
gst_object_unref (sinkpad); gst_object_unref (sinkpad);
} }
have_audio_sink = TRUE;
} }
if ((sink = group->video_sink)) { if ((sink = group->video_sink)) {
@ -3738,6 +3740,7 @@ autoplug_query_cb (GstElement * uridecodebin, GstPad * pad, GstQuery * query,
} }
gst_object_unref (sinkpad); gst_object_unref (sinkpad);
} }
have_video_sink = TRUE;
} }
factories = autoplug_factories_cb (uridecodebin, pad, NULL, group); factories = autoplug_factories_cb (uridecodebin, pad, NULL, group);
@ -3749,10 +3752,20 @@ autoplug_query_cb (GstElement * uridecodebin, GstPad * pad, GstQuery * query,
const GList *l; const GList *l;
GstCaps *templ_caps; GstCaps *templ_caps;
if (!gst_element_factory_list_is_type (GST_ELEMENT_FACTORY_CAST (factory), if (!gst_element_factory_list_is_type (factory,
GST_ELEMENT_FACTORY_TYPE_SINK)) GST_ELEMENT_FACTORY_TYPE_SINK))
continue; continue;
if (have_audio_sink
&& gst_element_factory_list_is_type (factory,
GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO))
continue;
if (have_video_sink
&& gst_element_factory_list_is_type (factory,
GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO |
GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE))
continue;
templates = gst_element_factory_get_static_pad_templates (factory); templates = gst_element_factory_get_static_pad_templates (factory);
for (l = templates; l; l = l->next) { for (l = templates; l; l = l->next) {