ffmpeg | branch: master | Mark Thompson <s...@jkqxz.net> | Sun Feb  4 13:24:33 
2024 +0000| [fa580a0f17f72a54a2effe89bf10b00b28203d87] | committer: Mark 
Thompson

lavc/d3d12va: Improve behaviour on missing decoder support

Distinguish between a decoder being entirely missing and a decoder which
requires features which are not present in the incomplete implementation
in libavcodec and therefore can't be used.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa580a0f17f72a54a2effe89bf10b00b28203d87
---

 libavcodec/d3d12va_decode.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
index f678b6f483..9bb8db1690 100644
--- a/libavcodec/d3d12va_decode.c
+++ b/libavcodec/d3d12va_decode.c
@@ -239,10 +239,14 @@ static int d3d12va_create_decoder(AVCodecContext *avctx)
 
     DX_CHECK(ID3D12VideoDevice_CheckFeatureSupport(device_hwctx->video_device, 
D3D12_FEATURE_VIDEO_DECODE_SUPPORT,
                                                    &feature, sizeof(feature)));
-    if (!(feature.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED) ||
-        !(feature.DecodeTier >= D3D12_VIDEO_DECODE_TIER_2)) {
-        av_log(avctx, AV_LOG_ERROR, "D3D12 decoder doesn't support on this 
device\n");
-        return AVERROR(EINVAL);
+    if (!(feature.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED)) {
+        av_log(avctx, AV_LOG_ERROR, "D3D12 video decode is not supported on 
this device.\n");
+        return AVERROR(ENOSYS);
+    }
+    if (!(feature.DecodeTier >= D3D12_VIDEO_DECODE_TIER_2)) {
+        av_log(avctx, AV_LOG_ERROR, "D3D12 video decode on this device 
requires tier %d support, "
+               "but it is not implemented.\n", feature.DecodeTier);
+        return AVERROR_PATCHWELCOME;
     }
 
     desc = (D3D12_VIDEO_DECODER_DESC) {

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to