diff options
Diffstat (limited to 'video/decode/d3d.c')
-rw-r--r-- | video/decode/d3d.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/video/decode/d3d.c b/video/decode/d3d.c index cb323f9b01..a40cc90f7d 100644 --- a/video/decode/d3d.c +++ b/video/decode/d3d.c @@ -80,6 +80,18 @@ bool d3d11_check_decoding(ID3D11Device *dev) return !FAILED(hr) && (supported & D3D11_BIND_DECODER); } +#if HAVE_AVCODEC_HW_FRAMES_PARAMS +void d3d_hwframes_refine(struct lavc_ctx *ctx, AVBufferRef *hw_frames_ctx) +{ + AVHWFramesContext *fctx = (void *)hw_frames_ctx->data; + + if (fctx->format == AV_PIX_FMT_D3D11) { + AVD3D11VAFramesContext *hwctx = fctx->hwctx; + + hwctx->BindFlags |= D3D11_BIND_SHADER_RESOURCE; + } +} +#else void d3d_hwframes_refine(struct lavc_ctx *ctx, AVBufferRef *hw_frames_ctx) { AVHWFramesContext *fctx = (void *)hw_frames_ctx->data; @@ -119,6 +131,7 @@ void d3d_hwframes_refine(struct lavc_ctx *ctx, AVBufferRef *hw_frames_ctx) hwctx->BindFlags |= D3D11_BIND_SHADER_RESOURCE; } } +#endif AVBufferRef *d3d11_wrap_device_ref(ID3D11Device *device) { |