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;
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,
}
#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
#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;
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))
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VP9,
.pix_fmt = AV_PIX_FMT_DXVA2_VLD,
+ .init = ff_dxva2_decode_init,
+ .uninit = ff_dxva2_decode_uninit,
.start_frame = dxva2_vp9_start_frame,
.decode_slice = dxva2_vp9_decode_slice,
.end_frame = dxva2_vp9_end_frame,
.frame_priv_data_size = sizeof(struct vp9_dxva2_picture_context),
+ .priv_data_size = sizeof(FFDXVASharedContext),
};
#endif
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VP9,
.pix_fmt = AV_PIX_FMT_D3D11VA_VLD,
+ .init = ff_dxva2_decode_init,
+ .uninit = ff_dxva2_decode_uninit,
.start_frame = dxva2_vp9_start_frame,
.decode_slice = dxva2_vp9_decode_slice,
.end_frame = dxva2_vp9_end_frame,
.frame_priv_data_size = sizeof(struct vp9_dxva2_picture_context),
+ .priv_data_size = sizeof(FFDXVASharedContext),
+};
+#endif
+
+#if CONFIG_VP9_D3D11VA2_HWACCEL
+AVHWAccel ff_vp9_d3d11va2_hwaccel = {
+ .name = "vp9_d3d11va2",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VP9,
+ .pix_fmt = AV_PIX_FMT_D3D11,
+ .init = ff_dxva2_decode_init,
+ .uninit = ff_dxva2_decode_uninit,
+ .start_frame = dxva2_vp9_start_frame,
+ .decode_slice = dxva2_vp9_decode_slice,
+ .end_frame = dxva2_vp9_end_frame,
+ .frame_priv_data_size = sizeof(struct vp9_dxva2_picture_context),
+ .priv_data_size = sizeof(FFDXVASharedContext),
};
#endif