GstPad *sinkpad = NULL;
GValueArray *factories;
gint i, n;
+ gboolean have_audio_sink = FALSE, have_video_sink = FALSE;
if (GST_QUERY_TYPE (query) != GST_QUERY_CAPS)
return FALSE;
}
gst_object_unref (sinkpad);
}
+ have_audio_sink = TRUE;
}
if ((sink = group->video_sink)) {
}
gst_object_unref (sinkpad);
}
+ have_video_sink = TRUE;
}
factories = autoplug_factories_cb (uridecodebin, pad, NULL, group);
const GList *l;
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))
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);
for (l = templates; l; l = l->next) {