Commit 4c39892b authored by James Almer's avatar James Almer

avcodec/vdpau: fix compilation of mpeg1/mpeg4/vc1 decoders when h264 is disabled

Tested-by: 's avatarwm4 <nfxjfg@googlemail.com>
Tested-by: 's avatarPhilip Langdale <philipl@overt.org>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent dda69253
......@@ -358,7 +358,25 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
/* Obsolete non-hwaccel VDPAU support below... */
#if CONFIG_H264_VDPAU_DECODER && FF_API_VDPAU
#if FF_API_VDPAU
void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
{
struct vdpau_render_state *render = (struct vdpau_render_state*)data;
assert(render);
render->bitstream_buffers= av_fast_realloc(
render->bitstream_buffers,
&render->bitstream_buffers_allocated,
sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)
);
render->bitstream_buffers[render->bitstream_buffers_used].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf;
render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size;
render->bitstream_buffers_used++;
}
#if CONFIG_H264_VDPAU_DECODER
void ff_vdpau_h264_set_reference_frames(H264Context *h)
{
struct vdpau_render_state *render, *render_ref;
......@@ -427,23 +445,6 @@ void ff_vdpau_h264_set_reference_frames(H264Context *h)
}
}
void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
{
struct vdpau_render_state *render = (struct vdpau_render_state*)data;
assert(render);
render->bitstream_buffers= av_fast_realloc(
render->bitstream_buffers,
&render->bitstream_buffers_allocated,
sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)
);
render->bitstream_buffers[render->bitstream_buffers_used].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf;
render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size;
render->bitstream_buffers_used++;
}
void ff_vdpau_h264_picture_start(H264Context *h)
{
struct vdpau_render_state *render;
......@@ -506,7 +507,7 @@ void ff_vdpau_h264_picture_complete(H264Context *h)
}
#endif /* CONFIG_H264_VDPAU_DECODER */
#if (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) && FF_API_VDPAU
#if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
int buf_size, int slice_count)
{
......@@ -565,7 +566,7 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
}
#endif /* CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER */
#if CONFIG_VC1_VDPAU_DECODER && FF_API_VDPAU
#if CONFIG_VC1_VDPAU_DECODER
void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
int buf_size)
{
......@@ -636,7 +637,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
}
#endif /* (CONFIG_VC1_VDPAU_DECODER */
#if CONFIG_MPEG4_VDPAU_DECODER && FF_API_VDPAU
#if CONFIG_MPEG4_VDPAU_DECODER
void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t *buf,
int buf_size)
{
......@@ -692,6 +693,7 @@ void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t *buf,
render->bitstream_buffers_used = 0;
}
#endif /* CONFIG_MPEG4_VDPAU_DECODER */
#endif /* FF_API_VDPAU */
int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile)
{
......
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