History

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.

Mark Thompson committed 2 years ago

Commit fa580a01 parent 52cc89d1 file · +8 −4Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/d3d12va_decode.c+8−4
@@ -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) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t