27 #ifndef AVCODEC_THREAD_H 28 #define AVCODEC_THREAD_H 61 int *got_picture_ptr,
AVPacket *avpkt);
99 #if FF_API_THREAD_SAFE_CALLBACKS 110 #define ff_thread_get_format ff_get_format static int shift(int a, int b)
This structure describes decoded (raw) audio or video data.
void ff_thread_flush(AVCodecContext *avctx)
Wait for decoding threads to finish and reset internal state.
int ff_alloc_entries(AVCodecContext *avctx, int count)
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
void ff_thread_report_progress(ThreadFrame *f, int progress, int field)
Notify later decoding threads when part of their reference picture is ready.
void ff_thread_free(AVCodecContext *s)
enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Wrapper around get_format() for frame-multithreaded codecs.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int ff_slice_thread_execute_with_mainfunc(AVCodecContext *avctx, int(*action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr), int(*main_func)(AVCodecContext *c), void *arg, int *ret, int job_count)
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
void ff_thread_report_progress2(AVCodecContext *avctx, int field, int thread, int n)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
void ff_thread_finish_setup(AVCodecContext *avctx)
If the codec defines update_thread_context(), call this when they are ready for the next thread to st...
void ff_thread_await_progress(ThreadFrame *f, int progress, int field)
Wait for earlier decoding threads to finish reference pictures.
int ff_thread_init(AVCodecContext *s)
int( main_func)(AVCodecContext *c)
int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src)
Libavcodec external API header.
main external API structure.
void ff_reset_entries(AVCodecContext *avctx)
AVCodecContext * owner[2]
int( action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr)
refcounted data buffer API
#define flags(name, subs,...)
A reference to a data buffer.
int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)
Submit a new frame to a decoding thread.
void ff_thread_await_progress2(AVCodecContext *avctx, int field, int thread, int shift)
AVPixelFormat
Pixel format.
This structure stores compressed data.