[gst-devel] autoplug ranking for a better spider

Baker, Steve SBaker at CHELLO.com
Thu May 30 01:36:06 CEST 2002


The current autoplug algorithm has a few problems which could be summed up
as:
- it sometimes uses completely bogus elements to build a pipeline
- it sometimes uses inferior (mpg123) libs when better (mad) ones exist
- it cycles through many plugins (ogg, avi) when it should be checking
popular (mad) ones first (i'm not sure if this is really a problem)

I have a simple proposal to fix this which I would like some comment on.

A autoplug_rank integer could be added to the GstElementDetails struct which
every plugin must populate. This value would be:
- zero if the plugin should never be used for autoplugging
- the higher the value, the earlier it should be checked for autoplugging

Most plugins could just use a few predefined ranks, such as:
GST_AUTOPLUG_RANK_NONE = 0
GST_AUTOPLUG_RANK_PRIMARY = 256
GST_AUTOPLUG_RANK_SECONDARY = 128
GST_AUTOPLUG_RANK_MARGINAL = 64
or whatever.  Tweaks could be made so that some PRIMARY ranks are a bit
higher than others, so that they are tried first.

Then, the only change that is needed is in
gst_autoplug_factories_filters_with_sink_caps which would:
- ignore factories with GST_AUTOPLUG_RANK_NONE
- return a list which is sorted descending on autoplug_rank

And that is all there is to it.  Another option is to add the autoplug_rank
to the GstElementFactory struct, then only elements which want to
participate in autoplugging need to call
gst_element_factory_set_autoplug_rank.

Thoughts? Flames?

cheers




More information about the gstreamer-devel mailing list