summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2015-08-24 23:52:43 -0300
committerJames Almer <jamrial@gmail.com>2015-08-25 23:58:54 -0300
commit4c39892b6741c8553689fb73d5a2f64cd2a3c9eb (patch)
tree635188c5109051f6b5fde11dc14904d49ceb20c1 /libavcodec/vdpau.c
parentdda69253578fbde677a68392539cc3fb3808dce0 (diff)
avcodec/vdpau: fix compilation of mpeg1/mpeg4/vc1 decoders when h264 is disabled
Tested-by: wm4 <nfxjfg@googlemail.com> Tested-by: Philip Langdale <philipl@overt.org> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/vdpau.c')
-rw-r--r--libavcodec/vdpau.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 7cb8ad2566..b5304664d6 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -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)
{