Commit 4d216420 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '7948a51b'

* commit '7948a51b':
  vdpau: don't assume Picture and H264Picture are the same

Conflicts:
	libavcodec/vdpau.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents e98bac82 7948a51b
...@@ -45,12 +45,10 @@ AVVDPAUContext *av_alloc_vdpaucontext(void) ...@@ -45,12 +45,10 @@ AVVDPAUContext *av_alloc_vdpaucontext(void)
MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2) MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2)
int ff_vdpau_common_start_frame(Picture *pic, int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx,
av_unused const uint8_t *buffer, av_unused const uint8_t *buffer,
av_unused uint32_t size) av_unused uint32_t size)
{ {
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
pic_ctx->bitstream_buffers_allocated = 0; pic_ctx->bitstream_buffers_allocated = 0;
pic_ctx->bitstream_buffers_used = 0; pic_ctx->bitstream_buffers_used = 0;
pic_ctx->bitstream_buffers = NULL; pic_ctx->bitstream_buffers = NULL;
...@@ -100,9 +98,9 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -100,9 +98,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
} }
#endif #endif
int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t size) int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
const uint8_t *buf, uint32_t size)
{ {
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers; VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
buffers = av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated, buffers = av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated,
......
...@@ -162,7 +162,7 @@ static int vdpau_h264_start_frame(AVCodecContext *avctx, ...@@ -162,7 +162,7 @@ static int vdpau_h264_start_frame(AVCodecContext *avctx,
vdpau_h264_set_reference_frames(avctx); vdpau_h264_set_reference_frames(avctx);
return ff_vdpau_common_start_frame(pic, buffer, size); return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
} }
static const uint8_t start_code_prefix[3] = { 0x00, 0x00, 0x01 }; static const uint8_t start_code_prefix[3] = { 0x00, 0x00, 0x01 };
...@@ -175,11 +175,11 @@ static int vdpau_h264_decode_slice(AVCodecContext *avctx, ...@@ -175,11 +175,11 @@ static int vdpau_h264_decode_slice(AVCodecContext *avctx,
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
int val; int val;
val = ff_vdpau_add_buffer(pic, start_code_prefix, 3); val = ff_vdpau_add_buffer(pic_ctx, start_code_prefix, 3);
if (val) if (val)
return val; return val;
val = ff_vdpau_add_buffer(pic, buffer, size); val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
if (val) if (val)
return val; return val;
......
...@@ -77,10 +77,11 @@ struct vdpau_picture_context { ...@@ -77,10 +77,11 @@ struct vdpau_picture_context {
}; };
#endif #endif
int ff_vdpau_common_start_frame(Picture *pic, int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic,
const uint8_t *buffer, uint32_t size); const uint8_t *buffer, uint32_t size);
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx); int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx);
int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t buf_size); int ff_vdpau_add_buffer(struct vdpau_picture_context *pic, const uint8_t *buf,
uint32_t buf_size);
void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf,
......
...@@ -75,7 +75,7 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx, ...@@ -75,7 +75,7 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx,
info->non_intra_quantizer_matrix[i] = s->inter_matrix[i]; info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
} }
return ff_vdpau_common_start_frame(pic, buffer, size); return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
} }
static int vdpau_mpeg_decode_slice(AVCodecContext *avctx, static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
...@@ -86,7 +86,7 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx, ...@@ -86,7 +86,7 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
int val; int val;
val = ff_vdpau_add_buffer(pic, buffer, size); val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
if (val < 0) if (val < 0)
return val; return val;
......
...@@ -77,8 +77,8 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx, ...@@ -77,8 +77,8 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx,
info->non_intra_quantizer_matrix[i] = s->inter_matrix[i]; info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
} }
ff_vdpau_common_start_frame(pic, buffer, size); ff_vdpau_common_start_frame(pic_ctx, buffer, size);
return ff_vdpau_add_buffer(pic, buffer, size); return ff_vdpau_add_buffer(pic_ctx, buffer, size);
} }
static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx, static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx,
......
...@@ -93,7 +93,7 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, ...@@ -93,7 +93,7 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx,
info->deblockEnable = v->postprocflag & 1; info->deblockEnable = v->postprocflag & 1;
info->pquant = v->pq; info->pquant = v->pq;
return ff_vdpau_common_start_frame(pic, buffer, size); return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
} }
static int vdpau_vc1_decode_slice(AVCodecContext *avctx, static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
...@@ -105,7 +105,7 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx, ...@@ -105,7 +105,7 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
int val; int val;
val = ff_vdpau_add_buffer(pic, buffer, size); val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
if (val < 0) if (val < 0)
return val; return val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment