Search code examples
gstreamervaapi

How do I change the rank of a Gstreamer plugin?


I've downloaded and compiled the vaapi plugin set, and for some specific cases it works great, but it also breaks many of my existing pipelines. I'd like to modify Gstreamer to use other decoders first.

Is there a way to alter the rank of Gstreamer plugins without modifying the original sources?


Solution

  • I don't see a means of doing this at a configuration level in the Gstreamer registry file. This code does the trick though:

    GstRegistry* reg = gst_registry_get();
    
    GstPluginFeature* vaapi_decode = gst_registry_lookup_feature(reg, "vaapidecode");
    
    if(vaapi_decode == NULL) {
        return;
    }
    
    gst_plugin_feature_set_rank(vaapi_decode, GST_RANK_PRIMARY - 1);
    
    gst_object_unref(vaapi_decode);