Go to the documentation of this file.
19 #ifndef FFTOOLS_SYNC_QUEUE_H
20 #define FFTOOLS_SYNC_QUEUE_H
38 #define SQFRAME(frame) ((SyncQueueFrame){ .f = (frame) })
39 #define SQPKT(pkt) ((SyncQueueFrame){ .p = (pkt) })
118 #endif // FFTOOLS_SYNC_QUEUE_H
static int frame_samples(const SyncQueue *sq, SyncQueueFrame frame)
This structure describes decoded (raw) audio or video data.
int sq_add_stream(SyncQueue *sq, int limiting)
Add a new stream to the sync queue.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx, uint64_t max_frames)
Limit the number of output frames for stream with index stream_idx to max_frames.
int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame)
Read a frame from the queue.
SyncQueue * sq_alloc(enum SyncQueueType type, int64_t buf_size_us, void *logctx)
Allocate a sync queue of the given type.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
A sync queue provides timestamp synchronization between multiple streams.
This structure stores compressed data.
void sq_free(SyncQueue **sq)
void sq_frame_samples(SyncQueue *sq, unsigned int stream_idx, int frame_samples)
Set a constant output audio frame size, in samples.
int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame)
Submit a frame for the stream with index stream_idx.