diff options
author | Sebastien Zwickert <dilaroga@gmail.com> | 2012-08-12 17:03:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-14 03:39:23 +0200 |
commit | 7f3dfd2010c6f92447e34ccbbb303b0fd18997ff (patch) | |
tree | 1d2c8bc2601c0706a81db69bf6e27b7307a1b526 /libavcodec/vda_h264.c | |
parent | 47682ddc227742e9f401d3f33c4c07789381798a (diff) | |
download | ffmpeg-7f3dfd2010c6f92447e34ccbbb303b0fd18997ff.tar.gz |
vda: support synchronous decoding.
Note that the symbols used to run the hardware decoder in asynchronous mode
has been marked as deprecated and will be dropped at a future version dump.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vda_h264.c')
-rw-r--r-- | libavcodec/vda_h264.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c index a4a4c903fd..aaf974543f 100644 --- a/libavcodec/vda_h264.c +++ b/libavcodec/vda_h264.c @@ -47,7 +47,9 @@ static int decode_slice(AVCodecContext *avctx, if (!vda_ctx->decoder) return -1; - tmp = av_fast_realloc(vda_ctx->bitstream, &vda_ctx->ref_size, vda_ctx->bitstream_size+size+4); + tmp = av_fast_realloc(vda_ctx->bitstream, + &vda_ctx->ref_size, + vda_ctx->bitstream_size+size+4); if (!tmp) return AVERROR(ENOMEM); @@ -71,9 +73,14 @@ static int end_frame(AVCodecContext *avctx) if (!vda_ctx->decoder || !vda_ctx->bitstream) return -1; - status = ff_vda_decoder_decode(vda_ctx, vda_ctx->bitstream, - vda_ctx->bitstream_size, - frame->reordered_opaque); + if (vda_ctx->use_sync_decoding) { + status = ff_vda_sync_decode(vda_ctx); + frame->data[3] = (void*)vda_ctx->cv_buffer; + } else { + status = ff_vda_decoder_decode(vda_ctx, vda_ctx->bitstream, + vda_ctx->bitstream_size, + frame->reordered_opaque); + } if (status) av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status); @@ -89,5 +96,4 @@ AVHWAccel ff_h264_vda_hwaccel = { .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, - .priv_data_size = 0, }; |