summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp
diff options
context:
space:
mode:
authorLars Sutterud <lars.sutterud@qt.io>2024-05-02 10:21:27 +0200
committerLars Sutterud <lars.sutterud@qt.io>2024-05-02 14:08:50 +0000
commit4f91b409ca7d4d10f027e488afbcabf9efaf2098 (patch)
treefcdcd40d5b3f38c48aae02b4f69f8252e7abc2a1 /src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp
parent0f37234ac6dab1d5f63dabe63902a15e8ef96d4d (diff)
FFmpeg/VAAPI: Enable finding libva shared libraries from cache
This change prevents an issue where Qt fails to load the VA-API shared library libva, even though FFmpeg manages to find it. By adding the version number of the latest libva.so file as an argument to the overloaded function QLibrary::resolve, we make it possible for Qt to find libva in the cache if FFmpeg has already loaded it. Libva so files are numbered with VA-API version + 1, according to the source files: https://github.com/intel/libva/blob/master/configure.ac#L64 E.g. VA-API version 1.14 generates the filename libva.so.2 Pick-to: 6.7 6.5 Task-number: QTBUG-124586 Change-Id: I76c5a13d5f421272cff0ccfc613ec7cf0b148b06 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp')
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp b/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp
index ed2532e73..9860b53a0 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpegvaapisymbols.cpp
@@ -21,14 +21,15 @@ QT_BEGIN_NAMESPACE
static Libs loadLibs()
{
+ constexpr int version = VA_MAJOR_VERSION + 1;
Libs libs;
- libs.push_back(std::make_unique<QLibrary>("va"));
+ libs.push_back(std::make_unique<QLibrary>("va", version));
#ifdef DYNAMIC_RESOLVE_VA_DRM_SYMBOLS
- libs.push_back(std::make_unique<QLibrary>("va-drm"));
+ libs.push_back(std::make_unique<QLibrary>("va-drm", version));
#endif
#ifdef DYNAMIC_RESOLVE_VA_X11_SYMBOLS
- libs.push_back(std::make_unique<QLibrary>("va-x11"));
+ libs.push_back(std::make_unique<QLibrary>("va-x11", version));
#endif
if (LibSymbolsResolver::tryLoad(libs))