67 unsigned last_execute = 0;
92 c->
func2(avctx, c->
args, our_job, self_id);
148 c->
rets = &dummy_ret;
186 if (thread_count <= 1) {
210 for (i=0; i<thread_count; i++) {
static av_unused void pthread_cond_signal(pthread_cond_t *cond)
static av_unused void w32thread_init(void)
int ff_slice_thread_init(AVCodecContext *avctx)
static av_unused void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
memory handling functions
static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
pthread_cond_t current_job_cond
Multithreading support functions.
CRITICAL_SECTION pthread_mutex_t
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr, void *(*start_routine)(void *), void *arg)
int( action_func)(AVCodecContext *c, void *arg)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static void *attribute_align_arg worker(void *v)
pthread_mutex_t current_job_lock
static int pthread_mutex_init(pthread_mutex_t *m, void *attr)
int active_thread_type
Which multithreading methods are in use by the codec.
static int pthread_mutex_unlock(pthread_mutex_t *m)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_log(void *avcl, int level, const char *fmt,...)
void ff_thread_free(AVCodecContext *avctx)
static int thread_execute2(AVCodecContext *avctx, action_func2 *func2, void *arg, int *ret, int job_count)
static av_unused void pthread_join(pthread_t thread, void **value_ptr)
static int pthread_mutex_destroy(pthread_mutex_t *m)
static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
void ff_slice_thread_free(AVCodecContext *avctx)
#define FF_THREAD_SLICE
Decode more than one part of a single frame at once.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
#define attribute_align_arg
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
static int pthread_mutex_lock(pthread_mutex_t *m)
Libavcodec external API header.
main external API structure.
static av_always_inline void thread_park_workers(SliceThreadContext *c, int thread_count)
int( action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr)
common internal api header.
common internal and external API header
struct AVCodecInternal * internal
Private context used for internal data.
w32threads to pthreads wrapper
static int thread_execute(AVCodecContext *avctx, action_func *func, void *arg, int *ret, int job_count, int job_size)
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
pthread_cond_t last_job_cond
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)