summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJøger Hansegård <joger.hansegard@qt.io>2024-04-30 21:39:51 +0200
committerJøger Hansegård <joger.hansegard@qt.io>2024-05-06 12:48:19 +0200
commit7ae871a3b7931818f1e7fb0e8e54bf0c680cc1d7 (patch)
tree5fed20361b5717bb3fa83c373371b0ca25abf033
parentd28eb457f866415132cd8144f1cbca3694b0d86f (diff)
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 <artem.dyomin@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org>
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpeg.cpp7
1 files changed, 7 insertions, 0 deletions
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: