diff options
author | Jithin Nair <jithin.nair@qt.io> | 2024-04-16 14:36:12 +0530 |
---|---|---|
committer | Jithin Nair <jithin.nair@qt.io> | 2024-04-19 12:41:53 +0530 |
commit | 8da0d2f87a2398fdeeb1ec754fbc1f537464c7c3 (patch) | |
tree | b049c71e4c59527608a6cf69a2e5bf212a7d839a | |
parent | 794ad8d72339ffdd3d22c28ccdb8abc02877ff5b (diff) |
GStreamer: Rank down the gstreamer-vaapi plugins
Gstreamer-vaapi plugins not working while selecting driver as iHD.
Vaapi plugins are disabled from gstreamer release 1.22.0 and suggested
to use va plugins instead. Ranked down gstreamer-vaapi plugins if
Gstreamer version is less than 1.22
Task-number: QTBUG-123931
Pick-to: 6.5 6.7
Change-Id: I98965cda299394665947e0453699299e0320709d
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
-rw-r--r-- | src/plugins/multimedia/gstreamer/common/qgst_handle_types_p.h | 1 | ||||
-rw-r--r-- | src/plugins/multimedia/gstreamer/qgstreamerintegration.cpp | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/multimedia/gstreamer/common/qgst_handle_types_p.h b/src/plugins/multimedia/gstreamer/common/qgst_handle_types_p.h index 9f990c8e7..b72e92db1 100644 --- a/src/plugins/multimedia/gstreamer/common/qgst_handle_types_p.h +++ b/src/plugins/multimedia/gstreamer/common/qgst_handle_types_p.h @@ -240,6 +240,7 @@ using QUniqueGErrorHandle = QUniqueHandle<QGstImpl::QUniqueGErrorHandleTraits>; using QFileDescriptorHandle = QUniqueHandle<QGstImpl::QFileDescriptorHandleTraits>; using QGstContextHandle = QGstImpl::QGstMiniObjectHandleHelper<GstContext>::UniqueHandle; using QGstGstDateTimeHandle = QGstImpl::QGstMiniObjectHandleHelper<GstDateTime>::SharedHandle; +using QGstPluginFeatureHandle = QGstImpl::QGstHandleHelper<GstPluginFeature>::SharedHandle; #if QT_CONFIG(gstreamer_gl) using QGstGLContextHandle = QGstImpl::QGstHandleHelper<GstGLContext>::UniqueHandle; diff --git a/src/plugins/multimedia/gstreamer/qgstreamerintegration.cpp b/src/plugins/multimedia/gstreamer/qgstreamerintegration.cpp index be139cae0..4ee5b36e8 100644 --- a/src/plugins/multimedia/gstreamer/qgstreamerintegration.cpp +++ b/src/plugins/multimedia/gstreamer/qgstreamerintegration.cpp @@ -25,6 +25,33 @@ QGstreamerIntegration::QGstreamerIntegration() { gst_init(nullptr, nullptr); qCDebug(lcGstreamer) << "Using gstreamer version: " << gst_version_string(); + + if constexpr (!GST_CHECK_VERSION(1, 22, 0)) { + GstRegistry* reg = gst_registry_get(); + const auto pluginNames = { + "vaapidecodebin", + "vaapih264dec", + "vaapih264enc", + "vaapih265dec", + "vaapijpegdec", + "vaapijpegenc", + "vaapimpeg2dec", + "vaapipostproc", + "vaapisink", + "vaapivp8dec", + "vaapivp9dec" + }; + + for (auto name : pluginNames) { + QGstPluginFeatureHandle pluginFeature { + gst_registry_lookup_feature(reg, name), + QGstPluginFeatureHandle::HasRef, + }; + if (pluginFeature) { + gst_plugin_feature_set_rank(pluginFeature.get(), GST_RANK_PRIMARY - 1); + } + } + } } QPlatformMediaFormatInfo *QGstreamerIntegration::createFormatInfo() |