From 2852740e23f91d6775714d7cc29b9a73e1111ce0 Mon Sep 17 00:00:00 2001 From: RĂ©mi Denis-Courmont Date: Thu, 25 Jul 2013 22:30:20 +0300 Subject: vdpau: store picture data in picture's rather than codec's context Signed-off-by: Anton Khirnov --- libavcodec/vdpau_vc1.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'libavcodec/vdpau_vc1.c') diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c index 57d50fbcb0..c21a8610d5 100644 --- a/libavcodec/vdpau_vc1.c +++ b/libavcodec/vdpau_vc1.c @@ -32,9 +32,10 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { VC1Context * const v = avctx->priv_data; - AVVDPAUContext *hwctx = avctx->hwaccel_context; MpegEncContext * const s = &v->s; - VdpPictureInfoVC1 *info = &hwctx->info.vc1; + Picture *pic = s->current_picture_ptr; + struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; + VdpPictureInfoVC1 *info = &pic_ctx->info.vc1; VdpVideoSurface ref; /* fill LvPictureInfoVC1 struct */ @@ -88,20 +89,23 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, info->deblockEnable = v->postprocflag & 1; info->pquant = v->pq; - return ff_vdpau_common_start_frame(avctx, buffer, size); + return ff_vdpau_common_start_frame(pic, buffer, size); } static int vdpau_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { - AVVDPAUContext *hwctx = avctx->hwaccel_context; + VC1Context * const v = avctx->priv_data; + MpegEncContext * const s = &v->s; + Picture *pic = s->current_picture_ptr; + struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; int val; - val = ff_vdpau_add_buffer(avctx, buffer, size); + val = ff_vdpau_add_buffer(pic, buffer, size); if (val < 0) return val; - hwctx->info.vc1.slice_count++; + pic_ctx->info.vc1.slice_count++; return 0; } @@ -114,6 +118,7 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = { .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, + .priv_data_size = sizeof(struct vdpau_picture_context), }; #endif @@ -125,4 +130,5 @@ AVHWAccel ff_vc1_vdpau_hwaccel = { .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, + .priv_data_size = sizeof(struct vdpau_picture_context), }; -- cgit v1.2.3