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.
Unified · Split
| @@ -239,10 +239,14 @@ static int d3d12va_create_decoder(AVCodecContext *avctx) · 238 unmodified lines | |||
| 239 | 239 | ||
| 240 | DX_CHECK(ID3D12VideoDevice_CheckFeatureSupport(device_hwctx->video_device, D3D12_FEATURE_VIDEO_DECODE_SUPPORT, | 240 | DX_CHECK(ID3D12VideoDevice_CheckFeatureSupport(device_hwctx->video_device, D3D12_FEATURE_VIDEO_DECODE_SUPPORT, |
| 241 | &feature, sizeof(feature))); | 241 | &feature, sizeof(feature))); |
| 242 | if (!(feature.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED) || | 242 | if (!(feature.SupportFlags & D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED)) { |
| 243 | !(feature.DecodeTier >= D3D12_VIDEO_DECODE_TIER_2)) { | 243 | av_log(avctx, AV_LOG_ERROR, "D3D12 video decode is not supported on this device.\n"); |
| 244 | av_log(avctx, AV_LOG_ERROR, "D3D12 decoder doesn't support on this device\n"); | 244 | return AVERROR(ENOSYS); |
| 245 | return AVERROR(EINVAL); | 245 | } |
| 246 | if (!(feature.DecodeTier >= D3D12_VIDEO_DECODE_TIER_2)) { | ||
| 247 | av_log(avctx, AV_LOG_ERROR, "D3D12 video decode on this device requires tier %d support, " | ||
| 248 | "but it is not implemented.\n", feature.DecodeTier); | ||
| 249 | return AVERROR_PATCHWELCOME; | ||
| 246 | } | 250 | } |
| 247 | 251 | ||
| 248 | desc = (D3D12_VIDEO_DECODER_DESC) { | 252 | desc = (D3D12_VIDEO_DECODER_DESC) { |