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

Bu, Long long.bu at intel.com
Fri Feb 25 02:30:45 PST 2011


Mmm.., thanks for your sharing.
But What I what is something like configuration files that gstreamer can read to set ranks automatically.

Cheers.
Long

From: gstreamer-devel-bounces+long.bu=intel.com at lists.freedesktop.org [mailto:gstreamer-devel-bounces+long.bu=intel.com at lists.freedesktop.org] On Behalf Of Julien Moutte
Sent: Friday, February 25, 2011 6:10 PM
To: Discussion of the development of and with GStreamer
Subject: Re: How to change rank of a plugin by configuration(without change code and recompile)

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<http://www.fluendo.com/> & www.moovida.com<http://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<mailto: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<mailto: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/b3167175/attachment.htm>


More information about the gstreamer-devel mailing list