How to change rank of a plugin by configuration(without change code and recompile)

Julien Moutte julien at fluendo.com
Fri Feb 25 02:09:52 PST 2011


Here is how it's done in Moovida :

bp_enable_factory (const gchar *name, gboolean enable)
{
    GstRegistry *registry = NULL;
    GstElementFactory *factory = NULL;

    registry = gst_registry_get_default ();
    if (G_UNLIKELY (!registry)) {
        bp_debug ("failed retrieving default registry");
        goto beach;
    }

    factory = gst_element_factory_find (name);
    if (G_UNLIKELY (!factory)) {
        bp_debug ("unable to locate the %s factory", name);
        goto beach;
    }

    // Raise Rank to Primary + 2 as Fluendo codecs use Primary + 1.
    if (enable) {
        gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory),
GST_RANK_PRIMARY + 2);
    }
    else { // Or set it back to NONE.
        gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory),
GST_RANK_NONE);
    }

beach:
    if (factory && registry) {
        gst_registry_add_feature (registry, GST_PLUGIN_FEATURE (factory));
    }

    return;
}

Julien Moutte
CTO
Fluendo
San Francisco, USA & Barcelona, SPAIN
Tel BCN. +34 933 175 153
Tel USA. +1 415 773 5353

www.fluendo.com & www.moovida.com

P *Please consider the environment before printing this e-mail.*



On Fri, Feb 25, 2011 at 10:36 AM, Bu, Long <long.bu at intel.com> wrote:

> Hi,
>        I am wondering if there is a chance to change the rank of a plugin
> by some configuration without modifying code and rebuilding.
>
>        Thanks a lot!
>
> Cheers.
> Long
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110225/6e11c13f/attachment.htm>


More information about the gstreamer-devel mailing list