FFmpeg
Loading...
Searching...
No Matches
pthread_internal.h File Reference
#include "avcodec.h"

Go to the source code of this file.

Macros

#define MAX_AUTO_THREADS   16
 
#define THREAD_SENTINEL   0
 
#define OFFSET_ARRAY(...)
 Macros to help creating the above lists.
 
#define DEFINE_OFFSET_ARRAY(type, name, cnt_variable, mutexes, conds)
 

Functions

int ff_slice_thread_init (AVCodecContext *avctx)
 
void ff_slice_thread_free (AVCodecContext *avctx)
 
int ff_frame_thread_init (AVCodecContext *avctx)
 
void ff_frame_thread_free (AVCodecContext *avctx, int thread_count)
 
int ff_pthread_init (void *obj, const unsigned offsets[])
 Initialize/destroy a list of mutexes/conditions contained in a structure.
 
void ff_pthread_free (void *obj, const unsigned offsets[])
 

Macro Definition Documentation

◆ MAX_AUTO_THREADS

#define MAX_AUTO_THREADS   16

◆ THREAD_SENTINEL

#define THREAD_SENTINEL   0

Definition at line 34 of file pthread_internal.h.

Referenced by ff_pthread_free().

◆ OFFSET_ARRAY

#define OFFSET_ARRAY ( ...)
Value:
__VA_ARGS__, THREAD_SENTINEL
#define THREAD_SENTINEL

Macros to help creating the above lists.

mutexes and conds need to be parentheses-enclosed lists of offsets in the containing structure.

Definition at line 60 of file pthread_internal.h.

◆ DEFINE_OFFSET_ARRAY

#define DEFINE_OFFSET_ARRAY ( type,
name,
cnt_variable,
mutexes,
conds )
Value:
static const unsigned name ## _offsets[] = { offsetof(type, cnt_variable), \
OFFSET_ARRAY mutexes, \
OFFSET_ARRAY conds }
cl_device_type type
#define OFFSET_ARRAY(...)
Macros to help creating the above lists.
const char * name
Definition qsvenc.c:142

Definition at line 61 of file pthread_internal.h.

Function Documentation

◆ ff_slice_thread_init()

int ff_slice_thread_init ( AVCodecContext * avctx)

Definition at line 115 of file pthread_slice.c.

Referenced by ff_thread_init().

◆ ff_slice_thread_free()

void ff_slice_thread_free ( AVCodecContext * avctx)

Definition at line 72 of file pthread_slice.c.

Referenced by ff_slice_thread_init(), and ff_thread_free().

◆ ff_frame_thread_init()

int ff_frame_thread_init ( AVCodecContext * avctx)

Definition at line 909 of file pthread_frame.c.

Referenced by ff_thread_init().

◆ ff_frame_thread_free()

void ff_frame_thread_free ( AVCodecContext * avctx,
int thread_count )

Definition at line 743 of file pthread_frame.c.

Referenced by ff_frame_thread_init(), and ff_thread_free().

◆ ff_pthread_init()

int ff_pthread_init ( void * obj,
const unsigned offsets[] )

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.

Parameters
objThe object containing the mutexes/conditions.
[in]offsetsAn 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 105 of file pthread.c.

Referenced by ff_frame_thread_encoder_init(), ff_frame_thread_init(), ff_thread_progress_init(), init_thread(), oh_decode_init(), and vp9_decode_init().

◆ ff_pthread_free()

void ff_pthread_free ( void * obj,
const unsigned offsets[] )