FFmpeg
|
#include <string.h>
Go to the source code of this file.
Enumerations | |
enum | ThreadQueueType { THREAD_QUEUE_FRAMES, THREAD_QUEUE_PACKETS } |
Functions | |
ThreadQueue * | tq_alloc (unsigned int nb_streams, size_t queue_size, enum ThreadQueueType type) |
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... | |
enum ThreadQueueType |
Enumerator | |
---|---|
THREAD_QUEUE_FRAMES | |
THREAD_QUEUE_PACKETS |
Definition at line 24 of file thread_queue.h.
ThreadQueue* tq_alloc | ( | unsigned int | nb_streams, |
size_t | queue_size, | ||
enum ThreadQueueType | type | ||
) |
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 |
Definition at line 71 of file thread_queue.c.
Referenced by queue_alloc().
void tq_free | ( | ThreadQueue ** | tq | ) |
Definition at line 53 of file thread_queue.c.
Referenced by sch_free(), 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 116 of file thread_queue.c.
Referenced by demux_flush(), demux_stream_send_to_dst(), enc_send_to_dst(), mux_task_start(), sch_mux_sub_heartbeat(), send_to_enc_thread(), send_to_filter(), and send_to_mux().
void tq_send_finish | ( | ThreadQueue * | tq, |
unsigned int | stream_idx | ||
) |
Mark the given stream finished from the sending side.
Definition at line 223 of file thread_queue.c.
Referenced by demux_stream_send_to_dst(), enc_send_to_dst(), mux_task_start(), send_to_enc_thread(), send_to_filter(), and send_to_mux().
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 193 of file thread_queue.c.
Referenced by sch_dec_receive(), sch_enc_receive(), sch_filter_receive(), and sch_mux_receive().
void tq_receive_finish | ( | ThreadQueue * | tq, |
unsigned int | stream_idx | ||
) |
Mark the given stream finished from the receiving side.
Definition at line 238 of file thread_queue.c.
Referenced by dec_done(), enc_done(), filter_done(), mux_done(), sch_filter_receive_finish(), and sch_mux_receive_finish().