FFmpeg
Data Fields
PerThreadContext Struct Reference

Context used by codec threads and stored in their AVCodecInternal thread_ctx. More...

Data Fields

struct FrameThreadContextparent
 
pthread_t thread
 
int thread_init
 
unsigned pthread_init_cnt
 Number of successfully initialized mutexes/conditions. More...
 
pthread_cond_t input_cond
 Used to wait for a new packet from the main thread. More...
 
pthread_cond_t progress_cond
 Used by child threads to wait for progress to change. More...
 
pthread_cond_t output_cond
 Used by the main thread to wait for frames to finish. More...
 
pthread_mutex_t mutex
 Mutex used to protect the contents of the PerThreadContext. More...
 
pthread_mutex_t progress_mutex
 Mutex used to protect frame progress values and progress_cond. More...
 
AVCodecContextavctx
 Context used to decode packets passed to this thread. More...
 
AVPacketavpkt
 Input packet (for decoding) or output (for encoding). More...
 
AVFrameframe
 Output frame (for decoding) or input (for encoding). More...
 
int got_frame
 The output of got_picture_ptr from the last avcodec_decode_video() call. More...
 
int result
 The result of the last codec decode/encode() call. More...
 
atomic_int state
 
AVFrame ** released_buffers
 Array of frames passed to ff_thread_release_buffer(). More...
 
int num_released_buffers
 
int released_buffers_allocated
 
AVFramerequested_frame
 AVFrame the codec passed to get_buffer() More...
 
int requested_flags
 flags passed to get_buffer() for requested_frame More...
 
enum AVPixelFormatavailable_formats
 Format array for get_format() More...
 
enum AVPixelFormat result_format
 get_format() result More...
 
int die
 Set when the thread should exit. More...
 
int hwaccel_serializing
 
int async_serializing
 
atomic_int debug_threads
 Set if the FF_DEBUG_THREADS option is set. More...
 

Detailed Description

Context used by codec threads and stored in their AVCodecInternal thread_ctx.

Definition at line 78 of file pthread_frame.c.

Field Documentation

◆ parent

struct FrameThreadContext* PerThreadContext::parent

◆ thread

pthread_t PerThreadContext::thread

Definition at line 81 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), and init_thread().

◆ thread_init

int PerThreadContext::thread_init

Definition at line 82 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), and init_thread().

◆ pthread_init_cnt

unsigned PerThreadContext::pthread_init_cnt

Number of successfully initialized mutexes/conditions.

Definition at line 83 of file pthread_frame.c.

◆ input_cond

pthread_cond_t PerThreadContext::input_cond

Used to wait for a new packet from the main thread.

Definition at line 84 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), frame_worker_thread(), and submit_packet().

◆ progress_cond

pthread_cond_t PerThreadContext::progress_cond

◆ output_cond

pthread_cond_t PerThreadContext::output_cond

Used by the main thread to wait for frames to finish.

Definition at line 86 of file pthread_frame.c.

Referenced by ff_thread_decode_frame(), frame_worker_thread(), and park_frame_worker_threads().

◆ mutex

pthread_mutex_t PerThreadContext::mutex

Mutex used to protect the contents of the PerThreadContext.

Definition at line 88 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), frame_worker_thread(), and submit_packet().

◆ progress_mutex

pthread_mutex_t PerThreadContext::progress_mutex

◆ avctx

AVCodecContext* PerThreadContext::avctx

Context used to decode packets passed to this thread.

Definition at line 91 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), ff_thread_decode_frame(), ff_thread_flush(), frame_worker_thread(), init_thread(), release_delayed_buffers(), and submit_packet().

◆ avpkt

AVPacket* PerThreadContext::avpkt

Input packet (for decoding) or output (for encoding).

Definition at line 93 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), ff_thread_decode_frame(), frame_worker_thread(), init_thread(), and submit_packet().

◆ frame

AVFrame* PerThreadContext::frame

Output frame (for decoding) or input (for encoding).

Definition at line 95 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), ff_thread_decode_frame(), ff_thread_flush(), frame_worker_thread(), and init_thread().

◆ got_frame

int PerThreadContext::got_frame

The output of got_picture_ptr from the last avcodec_decode_video() call.

Definition at line 96 of file pthread_frame.c.

Referenced by ff_thread_decode_frame(), ff_thread_flush(), frame_worker_thread(), and park_frame_worker_threads().

◆ result

int PerThreadContext::result

The result of the last codec decode/encode() call.

Definition at line 97 of file pthread_frame.c.

Referenced by ff_thread_decode_frame(), ff_thread_flush(), frame_worker_thread(), submit_packet(), and thread_get_buffer_internal().

◆ state

atomic_int PerThreadContext::state

◆ released_buffers

AVFrame** PerThreadContext::released_buffers

Array of frames passed to ff_thread_release_buffer().

Frames are released after all threads referencing them are finished.

Definition at line 106 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), and release_delayed_buffers().

◆ num_released_buffers

int PerThreadContext::num_released_buffers

Definition at line 107 of file pthread_frame.c.

Referenced by release_delayed_buffers().

◆ released_buffers_allocated

int PerThreadContext::released_buffers_allocated

Definition at line 108 of file pthread_frame.c.

Referenced by ff_frame_thread_free().

◆ requested_frame

AVFrame* PerThreadContext::requested_frame

AVFrame the codec passed to get_buffer()

Definition at line 110 of file pthread_frame.c.

Referenced by submit_packet(), and thread_get_buffer_internal().

◆ requested_flags

int PerThreadContext::requested_flags

flags passed to get_buffer() for requested_frame

Definition at line 111 of file pthread_frame.c.

Referenced by submit_packet(), and thread_get_buffer_internal().

◆ available_formats

enum AVPixelFormat* PerThreadContext::available_formats

Format array for get_format()

Definition at line 113 of file pthread_frame.c.

Referenced by ff_thread_get_format(), and submit_packet().

◆ result_format

enum AVPixelFormat PerThreadContext::result_format

get_format() result

Definition at line 114 of file pthread_frame.c.

Referenced by ff_thread_get_format(), and submit_packet().

◆ die

int PerThreadContext::die

Set when the thread should exit.

Definition at line 117 of file pthread_frame.c.

Referenced by ff_frame_thread_free(), and frame_worker_thread().

◆ hwaccel_serializing

int PerThreadContext::hwaccel_serializing

Definition at line 119 of file pthread_frame.c.

Referenced by ff_thread_finish_setup(), and frame_worker_thread().

◆ async_serializing

int PerThreadContext::async_serializing

Definition at line 120 of file pthread_frame.c.

Referenced by ff_thread_finish_setup(), and frame_worker_thread().

◆ debug_threads

atomic_int PerThreadContext::debug_threads

Set if the FF_DEBUG_THREADS option is set.

Definition at line 122 of file pthread_frame.c.

Referenced by ff_thread_await_progress(), ff_thread_report_progress(), init_thread(), and submit_packet().


The documentation for this struct was generated from the following file: