aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vda_h264.c
diff options
context:
space:
mode:
authorSebastien Zwickert <dilaroga@gmail.com>2012-08-14 11:45:29 +0200
committerDiego Biurrun <diego@biurrun.de>2012-08-14 12:47:27 +0200
commit3c37970637c0e3f1576cae58feed05497e383fc4 (patch)
tree2c75c5b770d105d5f1f1e487292171b8924e2fcd /libavcodec/vda_h264.c
parentcfc680ab3982f5c9e4240a9bb69859a49f420113 (diff)
downloadffmpeg-3c37970637c0e3f1576cae58feed05497e383fc4.tar.gz
vda: support synchronous decoding
Note that the symbols used to run the hardware decoder in asynchronous mode have been marked deprecated and will be dropped at a future version bump. Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/vda_h264.c')
-rw-r--r--libavcodec/vda_h264.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c
index a3f8c117c8..e621973432 100644
--- a/libavcodec/vda_h264.c
+++ b/libavcodec/vda_h264.c
@@ -73,9 +73,14 @@ static int end_frame(AVCodecContext *avctx)
if (!vda_ctx->decoder || !vda_ctx->priv_bitstream)
return -1;
- status = ff_vda_decoder_decode(vda_ctx, vda_ctx->priv_bitstream,
- vda_ctx->priv_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->priv_bitstream,
+ vda_ctx->priv_bitstream_size,
+ frame->reordered_opaque);
+ }
if (status)
av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);