From 31cf40886425fa587c8f7baa16c4c4104993fd33 Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri, 10 Jan 2014 16:43:27 +0100
Subject: [PATCH] vdpau: restore compatibility with deprecated fields in
AVVDPAUContext
---
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 32a3843..e294e49 100644
|
a
|
b
|
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
|
| 69 | 69 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 70 | 70 | VdpVideoSurface surf = ff_vdpau_get_surface_id(pic); |
| 71 | 71 | |
| | 72 | #if FF_API_BUFS_VDPAU |
| | 73 | FF_DISABLE_DEPRECATION_WARNINGS |
| | 74 | hwctx->info = pic_ctx->info; |
| | 75 | hwctx->bitstream_buffers = pic_ctx->bitstream_buffers; |
| | 76 | hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used; |
| | 77 | hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated; |
| | 78 | FF_ENABLE_DEPRECATION_WARNINGS |
| | 79 | #endif |
| | 80 | |
| 72 | 81 | if (!hwctx->render) { |
| 73 | 82 | res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info, |
| 74 | 83 | pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers); |
| … |
… |
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
|
| 79 | 88 | ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); |
| 80 | 89 | av_freep(&pic_ctx->bitstream_buffers); |
| 81 | 90 | |
| | 91 | #if FF_API_BUFS_VDPAU |
| | 92 | FF_DISABLE_DEPRECATION_WARNINGS |
| | 93 | hwctx->bitstream_buffers = NULL; |
| | 94 | hwctx->bitstream_buffers_used = 0; |
| | 95 | hwctx->bitstream_buffers_allocated = 0; |
| | 96 | FF_ENABLE_DEPRECATION_WARNINGS |
| | 97 | #endif |
| | 98 | |
| 82 | 99 | return res; |
| 83 | 100 | } |
| 84 | 101 | #endif |
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 3f6415d..ea69c14 100644
|
a
|
b
|
static int vdpau_h264_end_frame(AVCodecContext *avctx)
|
| 195 | 195 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 196 | 196 | VdpVideoSurface surf = ff_vdpau_get_surface_id(pic); |
| 197 | 197 | |
| | 198 | #if FF_API_BUFS_VDPAU |
| | 199 | FF_DISABLE_DEPRECATION_WARNINGS |
| | 200 | hwctx->info = pic_ctx->info; |
| | 201 | hwctx->bitstream_buffers = pic_ctx->bitstream_buffers; |
| | 202 | hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used; |
| | 203 | hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated; |
| | 204 | FF_ENABLE_DEPRECATION_WARNINGS |
| | 205 | #endif |
| | 206 | |
| 198 | 207 | if (!hwctx->render) { |
| 199 | 208 | res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info, |
| 200 | 209 | pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers); |
| … |
… |
static int vdpau_h264_end_frame(AVCodecContext *avctx)
|
| 205 | 214 | ff_h264_draw_horiz_band(h, 0, h->avctx->height); |
| 206 | 215 | av_freep(&pic_ctx->bitstream_buffers); |
| 207 | 216 | |
| | 217 | #if FF_API_BUFS_VDPAU |
| | 218 | FF_DISABLE_DEPRECATION_WARNINGS |
| | 219 | hwctx->bitstream_buffers = NULL; |
| | 220 | hwctx->bitstream_buffers_used = 0; |
| | 221 | hwctx->bitstream_buffers_allocated = 0; |
| | 222 | FF_ENABLE_DEPRECATION_WARNINGS |
| | 223 | #endif |
| | 224 | |
| 208 | 225 | return res; |
| 209 | 226 | } |
| 210 | 227 | |