FFmpeg
|
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "pthread_internal.h"
#include "thread.h"
Go to the source code of this file.
Macros | |
#define | PTHREAD_INIT_LOOP(type) |
Functions | |
static void | validate_thread_parameters (AVCodecContext *avctx) |
Set the threading algorithms used. More... | |
int | ff_thread_init (AVCodecContext *avctx) |
void | ff_thread_free (AVCodecContext *avctx) |
av_cold void | ff_pthread_free (void *obj, const unsigned offsets[]) |
av_cold int | ff_pthread_init (void *obj, const unsigned offsets[]) |
Initialize/destroy a list of mutexes/conditions contained in a structure. More... | |
#define PTHREAD_INIT_LOOP | ( | type | ) |
|
static |
Set the threading algorithms used.
Threading requires more than one thread. Frame threading requires entire frames to be passed to the codec, and introduces extra decoding delay, so is incompatible with low_delay.
avctx | The context. |
Definition at line 48 of file pthread.c.
Referenced by ff_thread_init().
int ff_thread_init | ( | AVCodecContext * | avctx | ) |
Definition at line 71 of file pthread.c.
Referenced by avcodec_open2().
void ff_thread_free | ( | AVCodecContext * | avctx | ) |
Definition at line 83 of file pthread.c.
Referenced by avcodec_close().
av_cold void ff_pthread_free | ( | void * | obj, |
const unsigned | offsets[] | ||
) |
Definition at line 91 of file pthread.c.
Referenced by cleanup(), ff_frame_thread_encoder_free(), ff_frame_thread_free(), ff_frame_thread_init(), and vp9_decode_free().
Initialize/destroy a list of mutexes/conditions contained in a structure.
The positions of these mutexes/conditions in the structure are given by their offsets. Because it is undefined behaviour to destroy an uninitialized mutex/condition, ff_pthread_init() stores the number of successfully initialized mutexes and conditions in the object itself and ff_pthread_free() uses this number to destroy exactly the mutexes and condition variables that have been successfully initialized.
obj | The object containing the mutexes/conditions. | |
[in] | offsets | An array of offsets. Its first member gives the offset of the variable that contains the count of successfully initialized mutexes/condition variables; said variable must be an unsigned int. Two arrays of offsets, each delimited by a THREAD_SENTINEL follow. The first contains the offsets of all the mutexes, the second contains the offsets of all the condition variables. |
Definition at line 104 of file pthread.c.
Referenced by ff_frame_thread_encoder_init(), ff_frame_thread_init(), init_thread(), omx_encode_init(), and vp9_decode_init().