summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2023-09-08 14:27:24 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-09 11:09:38 +0000
commit57681829b12f25617f22d2aa9b9afc9f35def4ec (patch)
treef620592a14448584ef157198137d3121aa8ee5c6
parentf1c4c426ec98439567f45c58a70ebee89ba37fd1 (diff)
Set AV_HWDEVICE_TYPE_CUDA first priority on Linux
The reason is that on nvidia graphic cards AV_HWDEVICE_TYPE_VAAPI gets failed on the vaapi hw format selection, and it falls back to sw decoding. Let's go with AV_HWDEVICE_TYPE_CUDA first on nvidia cards; on other cards, nvidia drivers cannot be detected and cuda is not used. Change-Id: I605f5525334ecb06198a8e1e410e637e32a8ee32 Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit ff5b7a1b1e9c5470a1db10785f32eb00437c26fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
index 6d627a9b1..8ad3cc391 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
@@ -40,8 +40,9 @@ static const std::initializer_list<AVHWDeviceType> preferredHardwareAccelerators
#if defined(Q_OS_ANDROID)
AV_HWDEVICE_TYPE_MEDIACODEC,
#elif defined(Q_OS_LINUX)
- AV_HWDEVICE_TYPE_VAAPI,
AV_HWDEVICE_TYPE_CUDA,
+ AV_HWDEVICE_TYPE_VAAPI,
+
// TODO: investigate VDPAU advantages.
// nvenc/nvdec codecs use AV_HWDEVICE_TYPE_CUDA by default, but they can also use VDPAU
// if it's included into the ffmpeg build and vdpau drivers are installed.