diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-21 21:34:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:38:30 +0100 |
commit | 759001c534287a96dc96d1e274665feb7059145d (patch) | |
tree | 6ace9560c20aa30db92067c5b45d7bd86e458d10 /libavcodec/thread.h | |
parent | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff) | |
download | ffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz |
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/thread.h')
-rw-r--r-- | libavcodec/thread.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libavcodec/thread.h b/libavcodec/thread.h index 99b0ce146a..864e67eb98 100644 --- a/libavcodec/thread.h +++ b/libavcodec/thread.h @@ -27,9 +27,19 @@ #ifndef AVCODEC_THREAD_H #define AVCODEC_THREAD_H +#include "libavutil/buffer.h" + #include "config.h" #include "avcodec.h" +typedef struct ThreadFrame { + AVFrame *f; + AVCodecContext *owner; + // progress->data is an array of 2 ints holding progress for top/bottom + // fields + AVBufferRef *progress; +} ThreadFrame; + /** * Wait for decoding threads to finish and reset internal state. * Called by avcodec_flush_buffers(). @@ -71,7 +81,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx); * @param field The field being decoded, for field-picture codecs. * 0 for top field or frame pictures, 1 for bottom field. */ -void ff_thread_report_progress(AVFrame *f, int progress, int field); +void ff_thread_report_progress(ThreadFrame *f, int progress, int field); /** * Wait for earlier decoding threads to finish reference pictures. @@ -85,7 +95,7 @@ void ff_thread_report_progress(AVFrame *f, int progress, int field); * @param field The field being referenced, for field-picture codecs. * 0 for top field or frame pictures, 1 for bottom field. */ -void ff_thread_await_progress(AVFrame *f, int progress, int field); +void ff_thread_await_progress(ThreadFrame *f, int progress, int field); /** * Wrapper around get_buffer() for frame-multithreaded codecs. @@ -95,7 +105,7 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field); * @param avctx The current context. * @param f The frame to write into. */ -int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f); +int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags); /** * Wrapper around release_buffer() frame-for multithreaded codecs. @@ -108,7 +118,9 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f); * @param avctx The current context. * @param f The picture being released. */ -void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f); +void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f); + +int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src); int ff_thread_init(AVCodecContext *s); void ff_thread_free(AVCodecContext *s); |