summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_mpeg4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/vaapi_mpeg4.c')
-rw-r--r--libavcodec/vaapi_mpeg4.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
index 5b2e9d4446..426bef2646 100644
--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -45,7 +45,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
{
Mpeg4DecContext *ctx = avctx->priv_data;
MpegEncContext * const s = &ctx->m;
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VAPictureParameterBufferMPEG4 *pic_param;
VAIQMatrixBufferMPEG4 *iq_matrix;
int i;
@@ -121,12 +121,13 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
{
MpegEncContext * const s = avctx->priv_data;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VASliceParameterBufferMPEG4 *slice_param;
ff_dlog(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
/* Fill in VASliceParameterBufferMPEG4 */
- slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
+ slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(vactx, buffer, size);
if (!slice_param)
return -1;
slice_param->macroblock_offset = get_bits_count(&s->gb) % 8;
@@ -145,6 +146,9 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = {
.start_frame = vaapi_mpeg4_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_mpeg4_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
#endif
@@ -157,5 +161,8 @@ AVHWAccel ff_h263_vaapi_hwaccel = {
.start_frame = vaapi_mpeg4_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_mpeg4_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
#endif