|
FFmpeg
|
#include <stdint.h>#include <string.h>#include "libavutil/avassert.h"#include "libavutil/error.h"#include "libavutil/fifo.h"#include "libavutil/mathematics.h"#include "libavutil/mem.h"#include "objpool.h"#include "sync_queue.h"Go to the source code of this file.
Data Structures | |
| struct | SyncQueueStream |
| struct | SyncQueue |
Functions | |
| static void | frame_move (const SyncQueue *sq, SyncQueueFrame dst, SyncQueueFrame src) |
| static int64_t | frame_ts (const SyncQueue *sq, SyncQueueFrame frame) |
| static int | frame_null (const SyncQueue *sq, SyncQueueFrame frame) |
| static void | finish_stream (SyncQueue *sq, unsigned int stream_idx) |
| static void | queue_head_update (SyncQueue *sq) |
| static void | stream_update_ts (SyncQueue *sq, unsigned int stream_idx, int64_t ts) |
| static int | overflow_heartbeat (SyncQueue *sq, int stream_idx) |
| int | sq_send (SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame) |
| Submit a frame for the stream with index stream_idx. More... | |
| static int | receive_for_stream (SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame) |
| static int | receive_internal (SyncQueue *sq, int stream_idx, SyncQueueFrame frame) |
| int | sq_receive (SyncQueue *sq, int stream_idx, SyncQueueFrame frame) |
| Read a frame from the queue. More... | |
| int | sq_add_stream (SyncQueue *sq, int limiting) |
| Add a new stream to the sync queue. More... | |
| void | sq_set_tb (SyncQueue *sq, unsigned int stream_idx, AVRational tb) |
| Set the timebase for the stream with index stream_idx. More... | |
| void | sq_limit_frames (SyncQueue *sq, unsigned int stream_idx, uint64_t frames) |
| Limit the number of output frames for stream with index stream_idx to max_frames. More... | |
| SyncQueue * | sq_alloc (enum SyncQueueType type, int64_t buf_size_us) |
| Allocate a sync queue of the given type. More... | |
| void | sq_free (SyncQueue **psq) |
|
static |
Definition at line 66 of file sync_queue.c.
Referenced by receive_for_stream(), and sq_send().
|
static |
Definition at line 75 of file sync_queue.c.
Referenced by overflow_heartbeat(), receive_for_stream(), and sq_send().
|
static |
Definition at line 82 of file sync_queue.c.
Referenced by sq_send().
Definition at line 87 of file sync_queue.c.
Referenced by sq_limit_frames(), sq_send(), and stream_update_ts().
|
static |
Definition at line 121 of file sync_queue.c.
Referenced by stream_update_ts().
Definition at line 147 of file sync_queue.c.
Referenced by overflow_heartbeat(), and sq_send().
Definition at line 176 of file sync_queue.c.
Referenced by sq_receive().
| int sq_send | ( | SyncQueue * | sq, |
| unsigned int | stream_idx, | ||
| SyncQueueFrame | frame | ||
| ) |
Submit a frame for the stream with index stream_idx.
On success, the sync queue takes ownership of the frame and will reset the contents of the supplied frame. On failure, the frame remains owned by the caller.
Sending a frame with NULL contents marks the stream as finished.
Definition at line 234 of file sync_queue.c.
Referenced by close_output_stream(), flush_encoders(), submit_encode_frame(), and sync_queue_process().
|
static |
Definition at line 277 of file sync_queue.c.
Referenced by receive_internal().
|
static |
Definition at line 315 of file sync_queue.c.
Referenced by sq_receive().
| int sq_receive | ( | SyncQueue * | sq, |
| int | stream_idx, | ||
| SyncQueueFrame | frame | ||
| ) |
Read a frame from the queue.
| stream_idx | index of the stream to read a frame for. May be -1, then try to read a frame from any stream that is ready for output. |
| frame | output frame will be written here on success. The frame is owned by the caller. |
Definition at line 339 of file sync_queue.c.
Referenced by submit_encode_frame(), and sync_queue_process().
Add a new stream to the sync queue.
| limiting | whether the stream is limiting, i.e. no other stream can be longer than this one |
Definition at line 351 of file sync_queue.c.
Referenced by setup_sync_queues().
| void sq_set_tb | ( | SyncQueue * | sq, |
| unsigned int | stream_idx, | ||
| AVRational | tb | ||
| ) |
Set the timebase for the stream with index stream_idx.
Should be called before sending any frames for this stream.
Definition at line 378 of file sync_queue.c.
Referenced by init_output_stream_encode(), and of_stream_init().
Limit the number of output frames for stream with index stream_idx to max_frames.
Definition at line 393 of file sync_queue.c.
Referenced by setup_sync_queues().
| SyncQueue* sq_alloc | ( | enum SyncQueueType | type, |
| int64_t | buf_size_us | ||
| ) |
Allocate a sync queue of the given type.
| buf_size_us | maximum duration that will be buffered in microseconds |
Definition at line 405 of file sync_queue.c.
Referenced by setup_sync_queues().
| void sq_free | ( | SyncQueue ** | psq | ) |
Definition at line 428 of file sync_queue.c.
Referenced by of_close().
1.8.17