Hi all,
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... Thank you Walter _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Walter Lucetti
www.myzhar.com |
Well,
I found a solution using <code>GstElementFactory* x264enc = gst_element_factory_find ( "x264enc" ); if( x264enc==NULL ) { fprintf(stderr, "***** H264 encoder not available ***** \n\n" ); return false; } gst_object_unref( x264enc );</code> Is this the best way? Thank you Walter
Walter Lucetti
www.myzhar.com |
In reply to this post by Myzhar
Le 4 févr. 2017 4:43 AM, "Walter Lucetti" <[hidden email]> a écrit :
You can simply call gst_element_factory_get("omxh264dec", NULL), if the plugin is missing, it will return NULL.
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Myzhar
On Sat, 2017-02-04 at 10:39 +0100, Walter Lucetti wrote:
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
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thank you very much guys. I'm writing a streamer that can work both on desktop and embedded systems and I would like to use HW encoder/decoder when available. -- Walter Lucetti email: [hidden email] web: www.robot-home.it - www.opencv.it project: http://myzharbot.robot-home.it Il 05 Feb 2017 11:30, "Tim Müller" <[hidden email]> ha scritto:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Walter Lucetti
www.myzhar.com |
Free forum by Nabble | Edit this page |