[FFmpeg-cvslog] vdpau: restore compatibility with deprecated fields in AVVDPAUContext
Hendrik Leppkes
git at videolan.org
Sat Jan 11 00:21:16 CET 2014
ffmpeg | branch: release/2.1 | Hendrik Leppkes <h.leppkes at gmail.com> | Fri Jan 10 20:18:08 2014 +0100| [70028e917ce8121cd0f4eb63d38a9bbe92dc27b5] | committer: Carl Eugen Hoyos
vdpau: restore compatibility with deprecated fields in AVVDPAUContext
Fixes ticket #3133.
Signed-off-by: Hendrik Leppkes <h.leppkes at gmail.com>
Tested-by: EricV
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 23bc1351ad7db698da9348e23ee63ec7300a881d)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70028e917ce8121cd0f4eb63d38a9bbe92dc27b5
---
libavcodec/vdpau.c | 17 +++++++++++++++++
libavcodec/vdpau_h264.c | 17 +++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 7a4d145..3a66841 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -69,6 +69,15 @@ int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->info = pic_ctx->info;
+ hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
+ hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
+ hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
if (!hwctx->render) {
res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
@@ -79,6 +88,14 @@ int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
av_freep(&pic_ctx->bitstream_buffers);
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->bitstream_buffers = NULL;
+ hwctx->bitstream_buffers_used = 0;
+ hwctx->bitstream_buffers_allocated = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
return res;
}
#endif
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 3f6415d..ea69c14 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -195,6 +195,15 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->info = pic_ctx->info;
+ hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
+ hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
+ hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
if (!hwctx->render) {
res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
@@ -205,6 +214,14 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
ff_h264_draw_horiz_band(h, 0, h->avctx->height);
av_freep(&pic_ctx->bitstream_buffers);
+#if FF_API_BUFS_VDPAU
+FF_DISABLE_DEPRECATION_WARNINGS
+ hwctx->bitstream_buffers = NULL;
+ hwctx->bitstream_buffers_used = 0;
+ hwctx->bitstream_buffers_allocated = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
return res;
}
More information about the ffmpeg-cvslog
mailing list