diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-06 12:04:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-06 12:09:17 +0200 |
commit | b64b719ad5c212e197009fa3f1e7aa96255cbd28 (patch) | |
tree | 38b2b3d650a29e10136bf251277db559b3d2cb58 /libavcodec/vdpau.c | |
parent | 567c0dcee6745dc53d67e6de796270449b5753f7 (diff) | |
parent | fcc1022611f79c2f3aa2f392a5ce14c74be9c1d7 (diff) | |
download | ffmpeg-b64b719ad5c212e197009fa3f1e7aa96255cbd28.tar.gz |
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.c')
-rw-r--r-- | libavcodec/vdpau.c | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index 18d09ae980..9ac423a0eb 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -79,17 +79,12 @@ int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, return 0; } -#if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG1_VDPAU_HWACCEL || \ - CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \ - CONFIG_VC1_VDPAU_HWACCEL || CONFIG_WMV3_VDPAU_HWACCEL -int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx) +int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, + struct vdpau_picture_context *pic_ctx) { - int res = 0; AVVDPAUContext *hwctx = avctx->hwaccel_context; - MpegEncContext *s = avctx->priv_data; - Picture *pic = s->current_picture_ptr; - struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; - VdpVideoSurface surf = ff_vdpau_get_surface_id(pic->f); + VdpVideoSurface surf = ff_vdpau_get_surface_id(frame); + VdpStatus status; #if FF_API_BUFS_VDPAU FF_DISABLE_DEPRECATION_WARNINGS @@ -101,13 +96,13 @@ 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); + status = hwctx->render2(avctx, frame, (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); + status = hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info, + pic_ctx->bitstream_buffers_used, + pic_ctx->bitstream_buffers); - ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); av_freep(&pic_ctx->bitstream_buffers); #if FF_API_BUFS_VDPAU @@ -118,7 +113,25 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif - return res; + return vdpau_error(status); +} + +#if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG1_VDPAU_HWACCEL || \ + CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \ + CONFIG_VC1_VDPAU_HWACCEL || CONFIG_WMV3_VDPAU_HWACCEL +int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx) +{ + MpegEncContext *s = avctx->priv_data; + Picture *pic = s->current_picture_ptr; + struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; + int val; + + val = ff_vdpau_common_end_frame(avctx, pic->f, pic_ctx); + if (val < 0) + return val; + + ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); + return 0; } #endif |