summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau_h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-06 12:04:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-06 12:09:17 +0200
commitb64b719ad5c212e197009fa3f1e7aa96255cbd28 (patch)
tree38b2b3d650a29e10136bf251277db559b3d2cb58 /libavcodec/vdpau_h264.c
parent567c0dcee6745dc53d67e6de796270449b5753f7 (diff)
parentfcc1022611f79c2f3aa2f392a5ce14c74be9c1d7 (diff)
Merge commit 'fcc1022611f79c2f3aa2f392a5ce14c74be9c1d7'
* commit 'fcc1022611f79c2f3aa2f392a5ce14c74be9c1d7': vdpau: factor out common end-of-frame handling Conflicts: libavcodec/vdpau.c libavcodec/vdpau_h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vdpau_h264.c')
-rw-r--r--libavcodec/vdpau_h264.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 05a41d0402..c63f9a8d2a 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -189,41 +189,17 @@ static int vdpau_h264_decode_slice(AVCodecContext *avctx,
static int vdpau_h264_end_frame(AVCodecContext *avctx)
{
- int res = 0;
- AVVDPAUContext *hwctx = avctx->hwaccel_context;
H264Context *h = avctx->priv_data;
H264Picture *pic = h->cur_pic_ptr;
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
- VdpVideoSurface surf = ff_vdpau_get_surface_id(&pic->f);
-
-#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);
- } else
- hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
- pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
-
- ff_h264_draw_horiz_band(h, 0, h->avctx->height);
- av_freep(&pic_ctx->bitstream_buffers);
+ int val;
-#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
+ val = ff_vdpau_common_end_frame(avctx, &pic->f, pic_ctx);
+ if (val < 0)
+ return val;
- return res;
+ ff_h264_draw_horiz_band(h, 0, h->avctx->height);
+ return 0;
}
AVHWAccel ff_h264_vdpau_hwaccel = {