mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
only use ranked element factories for autoplugging. This is the only commit that needs to be backed out to reinstate ...
Original commit message from CVS: only use ranked element factories for autoplugging. This is the only commit that needs to be backed out to reinstate previous behaviour. Before your spider will work again, you will have to update/rebuild plugins and run gst-register.
This commit is contained in:
parent
c4cd6b8381
commit
6712bc3afa
1 changed files with 33 additions and 19 deletions
|
@ -221,19 +221,32 @@ gst_autoplug_factories_filters (GList *factories)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gint
|
||||||
|
gst_autoplug_rank_compare (const GstElementFactory *a, const GstElementFactory *b)
|
||||||
|
{
|
||||||
|
if (a->rank > b->rank) return -1;
|
||||||
|
return (a->rank < b->rank) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* returns all factories which have sinks with non-NULL caps and srcs with
|
/* returns all factories which have sinks with non-NULL caps and srcs with
|
||||||
* any caps.
|
* any caps. also only returns factories with a non-zero rank, and sorts by
|
||||||
|
* rank descending.
|
||||||
*/
|
*/
|
||||||
GList *
|
GList *
|
||||||
gst_autoplug_factories_filters_with_sink_caps (GList *factories)
|
gst_autoplug_factories_filters_with_sink_caps (GList *factories)
|
||||||
{
|
{
|
||||||
GList *ret = NULL;
|
GList *ret = NULL;
|
||||||
|
GstElementFactory *factory;
|
||||||
|
GList *templs;
|
||||||
|
|
||||||
while (factories)
|
while (factories)
|
||||||
{
|
{
|
||||||
GList *templs = ((GstElementFactory *) factories->data)->padtemplates;
|
factory = (GstElementFactory *) factories->data;
|
||||||
|
templs = factory->padtemplates;
|
||||||
|
if (factory->rank > 0){
|
||||||
gboolean have_src = FALSE;
|
gboolean have_src = FALSE;
|
||||||
gboolean have_sink = FALSE;
|
gboolean have_sink = FALSE;
|
||||||
|
|
||||||
while (templs)
|
while (templs)
|
||||||
{
|
{
|
||||||
if (GST_PAD_TEMPLATE_DIRECTION (templs->data) == GST_PAD_SRC)
|
if (GST_PAD_TEMPLATE_DIRECTION (templs->data) == GST_PAD_SRC)
|
||||||
|
@ -246,14 +259,15 @@ gst_autoplug_factories_filters_with_sink_caps (GList *factories)
|
||||||
}
|
}
|
||||||
if (have_src && have_sink)
|
if (have_src && have_sink)
|
||||||
{
|
{
|
||||||
ret = g_list_prepend (ret, factories->data);
|
ret = g_list_prepend (ret, factory);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
templs = g_list_next (templs);
|
templs = g_list_next (templs);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
factories = g_list_next (factories);
|
factories = g_list_next (factories);
|
||||||
}
|
}
|
||||||
return ret;
|
return g_list_sort(ret, (GCompareFunc)gst_autoplug_rank_compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue