FFmpeg
|
Go to the source code of this file.
Functions | |
SafeQueue * | ff_safe_queue_create (void) |
Create and initialize a SafeQueue instance. More... | |
void | ff_safe_queue_destroy (SafeQueue *sq) |
Destroy the SafeQueue instance. More... | |
size_t | ff_safe_queue_size (SafeQueue *sq) |
Return the length of the SafeQueue. More... | |
int | ff_safe_queue_push_front (SafeQueue *sq, void *v) |
Add data to the head of queue in the SafeQueue after locking mutex. More... | |
int | ff_safe_queue_push_back (SafeQueue *sq, void *v) |
Add data to the tail of queue in the SafeQueue after locking mutex. More... | |
void * | ff_safe_queue_pop_front (SafeQueue *sq) |
Remove and free first element from the queue in SafeQueue. More... | |
SafeQueue* ff_safe_queue_create | ( | void | ) |
Create and initialize a SafeQueue instance.
NULL | if initialization fails |
Definition at line 52 of file safe_queue.c.
Referenced by dnn_load_model_tf(), dnn_load_model_th(), and init_model_ov().
void ff_safe_queue_destroy | ( | SafeQueue * | sq | ) |
Destroy the SafeQueue instance.
It also frees all elements of the queue, destroys the mutex and condition variable.
Definition at line 69 of file safe_queue.c.
Referenced by dnn_free_model_ov(), dnn_free_model_tf(), and dnn_free_model_th().
size_t ff_safe_queue_size | ( | SafeQueue * | sq | ) |
Return the length of the SafeQueue.
Definition at line 80 of file safe_queue.c.
Referenced by dnn_free_model_ov(), dnn_free_model_tf(), and dnn_free_model_th().
int ff_safe_queue_push_front | ( | SafeQueue * | sq, |
void * | v | ||
) |
Add data to the head of queue in the SafeQueue after locking mutex.
After adding the data, it signals the condition variable and unlocks the mutex. It increases the length of queue in the SafeQueue by one.
sq | pointer to the SafeQueue |
v | data to be added |
0 | if the queue is not initialized |
-1 | if new entry cannot be created |
Definition at line 85 of file safe_queue.c.
int ff_safe_queue_push_back | ( | SafeQueue * | sq, |
void * | v | ||
) |
Add data to the tail of queue in the SafeQueue after locking mutex.
After adding the data, it signals the condition variable and unlocks the mutex. It increases the length of queue in the SafeQueue by one.
sq | pointer to the SafeQueue |
v | data to be added |
0 | if the queue is not initialized |
-1 | if new entry cannot be created |
Definition at line 95 of file safe_queue.c.
Referenced by dnn_flush_tf(), dnn_load_model_tf(), dnn_load_model_th(), execute_model_ov(), execute_model_tf(), execute_model_th(), infer_completion_callback(), and init_model_ov().
void* ff_safe_queue_pop_front | ( | SafeQueue * | sq | ) |
Remove and free first element from the queue in SafeQueue.
Before removing, it waits for the condition variable to signal and acquires the mutex. Finally, it signals the condition and unlocks the mutex. It shrinks the length of queue in the SafeQueue by one.
sq | pointer to the SafeQueue. |
Definition at line 105 of file safe_queue.c.
Referenced by dnn_execute_model_tf(), dnn_execute_model_th(), dnn_flush_tf(), dnn_flush_th(), dnn_free_model_ov(), dnn_free_model_tf(), dnn_free_model_th(), get_output_ov(), get_output_tf(), and get_output_th().