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/threadframe.h | |
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/threadframe.h')
-rw-r--r-- | libavcodec/threadframe.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/threadframe.h b/libavcodec/threadframe.h index c2caf511b9..be63e62435 100644 --- a/libavcodec/threadframe.h +++ b/libavcodec/threadframe.h @@ -50,4 +50,28 @@ void ff_thread_report_progress(ThreadFrame *f, int progress, int field); */ void ff_thread_await_progress(ThreadFrame *f, int progress, int field); +/** + * Wrapper around ff_get_buffer() for frame-multithreaded codecs. + * Call this function instead of ff_get_buffer() if you might need + * to wait for progress on this frame. + * Cannot be called after the codec has called ff_thread_finish_setup(). + * + * @param avctx The current context. + * @param f The frame to write into. + * @note: It is fine to call this with codecs that do not support + * frame threading. + */ +int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags); + +/** + * Unref a ThreadFrame. + * + * This is basically a wrapper around av_frame_unref() and should + * be called instead of it. + * + * @param avctx The current context. + * @param f The picture being released. + */ +void ff_thread_release_ext_buffer(AVCodecContext *avctx, ThreadFrame *f); + #endif |