FFmpeg
|
Go to the source code of this file.
Functions | |
ThreadQueue * | tq_alloc (unsigned int nb_streams, size_t queue_size, ObjPool *obj_pool, void(*obj_move)(void *dst, void *src)) |
Allocate a queue for sending data between threads. More... | |
void | tq_free (ThreadQueue **tq) |
int | tq_send (ThreadQueue *tq, unsigned int stream_idx, void *data) |
Send an item for the given stream to the queue. More... | |
void | tq_send_finish (ThreadQueue *tq, unsigned int stream_idx) |
Mark the given stream finished from the sending side. More... | |
int | tq_receive (ThreadQueue *tq, int *stream_idx, void *data) |
Read the next item from the queue. More... | |
void | tq_receive_finish (ThreadQueue *tq, unsigned int stream_idx) |
Mark the given stream finished from the receiving side. More... | |
ThreadQueue* tq_alloc | ( | unsigned int | nb_streams, |
size_t | queue_size, | ||
ObjPool * | obj_pool, | ||
void(*)(void *dst, void *src) | obj_move | ||
) |
Allocate a queue for sending data between threads.
nb_streams | number of streams for which a distinct EOF state is maintained |
queue_size | number of items that can be stored in the queue without blocking |
obj_pool | object pool that will be used to allocate items stored in the queue; the pool becomes owned by the queue |
callback | that moves the contents between two data pointers |
Definition at line 79 of file thread_queue.c.
Referenced by dec_thread_start(), and thread_start().
void tq_free | ( | ThreadQueue ** | tq | ) |
Definition at line 55 of file thread_queue.c.
Referenced by dec_thread_start(), dec_thread_stop(), thread_start(), thread_stop(), and tq_alloc().
int tq_send | ( | ThreadQueue * | tq, |
unsigned int | stream_idx, | ||
void * | data | ||
) |
Send an item for the given stream to the queue.
data | the item to send, its contents will be moved using the callback provided to tq_alloc(); on failure the item will be left untouched |
Definition at line 120 of file thread_queue.c.
Referenced by dec_packet(), decoder_thread(), packet_decode(), thread_submit_packet(), and transcode_subtitles().
void tq_send_finish | ( | ThreadQueue * | tq, |
unsigned int | stream_idx | ||
) |
Mark the given stream finished from the sending side.
Definition at line 217 of file thread_queue.c.
Referenced by dec_packet(), dec_thread_stop(), decoder_thread(), thread_stop(), and thread_submit_packet().
int tq_receive | ( | ThreadQueue * | tq, |
int * | stream_idx, | ||
void * | data | ||
) |
Read the next item from the queue.
stream_idx | the index of the stream that was processed or -1 will be written here |
data | the data item will be written here on success using the callback provided to tq_alloc() |
Definition at line 191 of file thread_queue.c.
Referenced by dec_packet(), decoder_thread(), and muxer_thread().
void tq_receive_finish | ( | ThreadQueue * | tq, |
unsigned int | stream_idx | ||
) |
Mark the given stream finished from the receiving side.
Definition at line 232 of file thread_queue.c.
Referenced by dec_thread_stop(), decoder_thread(), and muxer_thread().