diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-02-06 09:44:10 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-02-09 19:22:23 +0300 |
commit | f025b8e110b36c1cdb4fb56c4cd57aeca1767b5b (patch) | |
tree | 3b668e0c57158154ea4b7bdaa13cbd5ad23221da /libavcodec/ffv1dec.c | |
parent | b3551b6072687539c9e162fcec9e1e42a668ee8c (diff) |
avcodec/threadframe: Add ff_thread_(get|release)_ext_buffer()
These will be used by the codecs that need allocated progress
and is in preparation for no longer using ThreadFrame by the codecs
that don't.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r-- | libavcodec/ffv1dec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 3f90a8fb55..45ecf3152e 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -842,7 +842,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac AVFrame *p; if (f->last_picture.f) - ff_thread_release_buffer(avctx, &f->last_picture); + ff_thread_release_ext_buffer(avctx, &f->last_picture); FFSWAP(ThreadFrame, f->picture, f->last_picture); f->cur = p = f->picture.f; @@ -874,7 +874,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac p->key_frame = 0; } - if ((ret = ff_thread_get_buffer(avctx, &f->picture, AV_GET_BUFFER_FLAG_REF)) < 0) + ret = ff_thread_get_ext_buffer(avctx, &f->picture, AV_GET_BUFFER_FLAG_REF); + if (ret < 0) return ret; if (avctx->debug & FF_DEBUG_PICT_INFO) @@ -966,7 +967,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac ff_thread_report_progress(&f->picture, INT_MAX, 0); if (f->last_picture.f) - ff_thread_release_buffer(avctx, &f->last_picture); + ff_thread_release_ext_buffer(avctx, &f->last_picture); if ((ret = av_frame_ref(data, f->picture.f)) < 0) return ret; @@ -1037,7 +1038,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) av_assert1(fdst->max_slice_count == fsrc->max_slice_count); - ff_thread_release_buffer(dst, &fdst->picture); + ff_thread_release_ext_buffer(dst, &fdst->picture); if (fsrc->picture.f->data[0]) { if ((ret = ff_thread_ref_frame(&fdst->picture, &fsrc->picture)) < 0) return ret; |