|
|
|
@ -72,23 +72,36 @@ int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, |
|
|
|
|
struct vdpau_picture_context *pic_ctx) |
|
|
|
|
{ |
|
|
|
|
AVVDPAUContext *hwctx = avctx->hwaccel_context; |
|
|
|
|
VdpVideoSurface surf = ff_vdpau_get_surface_id(frame); |
|
|
|
|
VdpStatus status; |
|
|
|
|
|
|
|
|
|
status = hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info, |
|
|
|
|
pic_ctx->bitstream_buffers_used, |
|
|
|
|
pic_ctx->bitstream_buffers); |
|
|
|
|
|
|
|
|
|
av_freep(&pic_ctx->bitstream_buffers); |
|
|
|
|
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) |
|
|
|
|
{ |
|
|
|
|
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); |
|
|
|
|
int val; |
|
|
|
|
|
|
|
|
|
hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info, |
|
|
|
|
pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers); |
|
|
|
|
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); |
|
|
|
|
av_freep(&pic_ctx->bitstream_buffers); |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|