Check Plugin availability runtime

Tim Müller tim at centricular.com
Sun Feb 5 10:29:39 UTC 2017


On Sat, 2017-02-04 at 10:39 +0100, Walter Lucetti wrote:

> how can I check runtime if a plugin is available in my C++ code?
> 
> To be more precise I would like to check if I can use omxh264enc to
> encode H264, if not I use xh264enc...

if (!gst_registry_check_feature_version (gst_registry_get(),
    "omxh264", GST_VERSION_MAJOR, 0, 0)) {
  ...
}

Alternatively, you could also find H.264 encoders programmatically
without knowing the names, something with:

 encs = gst_element_factory_list_get_elements
(GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER, GST_RANK_MARGINAL);
 
 h264_encoders = gst_element_factory_list_filter (encs, h264_caps,
GST_PAD_SRC, FALSE);

...

Cheers
 -Tim


-- 
Tim Müller, Centricular Ltd - http://www.centricular.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170205/e47bef80/attachment.html>


More information about the gstreamer-devel mailing list