diff options
author | wm4 <nfxjfg@googlemail.com> | 2017-06-06 18:51:09 +0200 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2017-06-27 18:05:02 +0200 |
commit | ab28108a361196134704071b7b34c42fc7d747c7 (patch) | |
tree | 15158729b2cab0687ff87d78618daba8d4e76071 /libavcodec/dxva2_vp9.c | |
parent | 865360ba633b09f1292d52ba6d07f16b6bcef6df (diff) |
dxva: preparations for new hwaccel API
The actual hwaccel code will need to access an internal context instead
of avctx->hwaccel_context, so add a new DXVA_CONTEXT() macro, that will
dispatch between the "old" external and the new internal context.
Also, the new API requires a new D3D11 pixfmt, so all places which check
for the pixfmt need to be adjusted. Introduce a ff_dxva2_is_d3d11()
function, which does the check.
Merges Libav commit 4dec101acc393fbfe9a8ce0237b9efbae3f20139.
Adds changes to vp9 over the Libav patch.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/dxva2_vp9.c')
-rw-r--r-- | libavcodec/dxva2_vp9.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/dxva2_vp9.c b/libavcodec/dxva2_vp9.c index fd7bd98afd..df098dc406 100644 --- a/libavcodec/dxva2_vp9.c +++ b/libavcodec/dxva2_vp9.c @@ -170,7 +170,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, DECODER_BUFFER_DESC *sc) { const VP9SharedContext *h = avctx->priv_data; - AVDXVAContext *ctx = avctx->hwaccel_context; + AVDXVAContext *ctx = DXVA_CONTEXT(avctx); struct vp9_dxva2_picture_context *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private; void *dxva_data_ptr; uint8_t *dxva_data; @@ -179,7 +179,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, unsigned type; #if CONFIG_D3D11VA - if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) { + if (ff_dxva2_is_d3d11(avctx)) { type = D3D11_VIDEO_DECODER_BUFFER_BITSTREAM; if (FAILED(ID3D11VideoContext_GetDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, @@ -214,7 +214,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, } #if CONFIG_D3D11VA - if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) + if (ff_dxva2_is_d3d11(avctx)) if (FAILED(ID3D11VideoContext_ReleaseDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, type))) return -1; #endif @@ -225,7 +225,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, #endif #if CONFIG_D3D11VA - if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) { + if (ff_dxva2_is_d3d11(avctx)) { D3D11_VIDEO_DECODER_BUFFER_DESC *dsc11 = bs; memset(dsc11, 0, sizeof(*dsc11)); dsc11->BufferType = type; @@ -258,7 +258,7 @@ static int dxva2_vp9_start_frame(AVCodecContext *avctx, av_unused uint32_t size) { const VP9SharedContext *h = avctx->priv_data; - AVDXVAContext *ctx = avctx->hwaccel_context; + AVDXVAContext *ctx = DXVA_CONTEXT(avctx); struct vp9_dxva2_picture_context *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private; if (!DXVA_CONTEXT_VALID(avctx, ctx)) |