From 57681829b12f25617f22d2aa9b9afc9f35def4ec Mon Sep 17 00:00:00 2001 From: Artem Dyomin Date: Fri, 8 Sep 2023 14:27:24 +0200 Subject: 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 Reviewed-by: Artem Dyomin (cherry picked from commit ff5b7a1b1e9c5470a1db10785f32eb00437c26fa) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 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. -- cgit v1.2.3