From 7ae871a3b7931818f1e7fb0e8e54bf0c680cc1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8ger=20Hanseg=C3=A5rd?= Date: Tue, 30 Apr 2024 21:39:51 +0200 Subject: Treat AV_HWDEVICE_TYPE_D3D12VA as other Windows device types FFmpeg 7.0 introduced the new AV_HWDEVICE_TYPE_D3D12VA device type. This patch ensures that this device type can be preferred with codecs with the "_mf" suffix. We also map the AV_HWDEVICE_TYPE_D3D12VA device type with the AV_PIX_FMT_D3D12 hardware pixel format. Task-number: QTBUG-124482 Pick-to: 6.7 6.5 Change-Id: I5f6cae1b44850157bb387be8511df3e5af620a26 Reviewed-by: Artem Dyomin Reviewed-by: Tim Blechmann --- src/plugins/multimedia/ffmpeg/qffmpeg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/multimedia/ffmpeg/qffmpeg.cpp b/src/plugins/multimedia/ffmpeg/qffmpeg.cpp index f769ac4d4..fe86e480f 100644 --- a/src/plugins/multimedia/ffmpeg/qffmpeg.cpp +++ b/src/plugins/multimedia/ffmpeg/qffmpeg.cpp @@ -338,6 +338,9 @@ const char *preferredHwCodecNameSuffix(bool isEncoder, AVHWDeviceType deviceType return "_videotoolbox"; case AV_HWDEVICE_TYPE_D3D11VA: case AV_HWDEVICE_TYPE_DXVA2: +#if QT_FFMPEG_HAS_D3D12VA + case AV_HWDEVICE_TYPE_D3D12VA: +#endif return "_mf"; case AV_HWDEVICE_TYPE_CUDA: case AV_HWDEVICE_TYPE_VDPAU: @@ -489,6 +492,10 @@ AVPixelFormat pixelFormatForHwDevice(AVHWDeviceType deviceType) return AV_PIX_FMT_QSV; case AV_HWDEVICE_TYPE_D3D11VA: return AV_PIX_FMT_D3D11; +#if QT_FFMPEG_HAS_D3D12VA + case AV_HWDEVICE_TYPE_D3D12VA: + return AV_PIX_FMT_D3D12; +#endif case AV_HWDEVICE_TYPE_DXVA2: return AV_PIX_FMT_DXVA2_VLD; case AV_HWDEVICE_TYPE_DRM: -- cgit v1.2.3