From babd340f584988446ef578e7dbc7064b19804f81 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 28 Jul 2015 11:16:12 +0200 Subject: vaapi: streamline public context structure. Move libavcodec managed objects from the public struct vaapi_context to a new privately owned FFVAContext. This is done so that to clean up and streamline the public structure, but also to prepare for new codec support, thus requiring new internal data to be added in there. The AVCodecContext.hwaccel_context, that holds the public vaapi_context, shall no longer be accessed from within vaapi_*.c codec support files. Signed-off-by: Gwenole Beauchesne --- libavcodec/vaapi_vc1.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libavcodec/vaapi_vc1.c') diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index 63d514d54e..5ded5dba89 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -148,7 +148,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t { VC1Context * const v = avctx->priv_data; MpegEncContext * const s = &v->s; - struct vaapi_context * const vactx = avctx->hwaccel_context; + FFVAContext * const vactx = ff_vaapi_get_context(avctx); VAPictureParameterBufferVC1 *pic_param; ff_dlog(avctx, "vaapi_vc1_start_frame()\n"); @@ -315,6 +315,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, { VC1Context * const v = avctx->priv_data; MpegEncContext * const s = &v->s; + FFVAContext * const vactx = ff_vaapi_get_context(avctx); VASliceParameterBufferVC1 *slice_param; ff_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size); @@ -326,7 +327,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, } /* Fill in VASliceParameterBufferVC1 */ - slice_param = (VASliceParameterBufferVC1 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size); + slice_param = (VASliceParameterBufferVC1 *)ff_vaapi_alloc_slice(vactx, buffer, size); if (!slice_param) return -1; slice_param->macroblock_offset = get_bits_count(&s->gb); @@ -343,6 +344,9 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = { .start_frame = vaapi_vc1_start_frame, .end_frame = ff_vaapi_mpeg_end_frame, .decode_slice = vaapi_vc1_decode_slice, + .init = ff_vaapi_context_init, + .uninit = ff_vaapi_context_fini, + .priv_data_size = sizeof(FFVAContext), }; #endif @@ -354,4 +358,7 @@ AVHWAccel ff_vc1_vaapi_hwaccel = { .start_frame = vaapi_vc1_start_frame, .end_frame = ff_vaapi_mpeg_end_frame, .decode_slice = vaapi_vc1_decode_slice, + .init = ff_vaapi_context_init, + .uninit = ff_vaapi_context_fini, + .priv_data_size = sizeof(FFVAContext), }; -- cgit v1.2.3