Go to the documentation of this file.
22 #ifndef AVFILTER_FRAMEQUEUE_H
23 #define AVFILTER_FRAMEQUEUE_H
FFFrameBucket first_bucket
Pre-allocated bucket for queues of size 1.
int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame)
Add a frame.
This structure describes decoded (raw) audio or video data.
FFFrameBucket * queue
Array of allocated buckets, used as a circular buffer.
size_t allocated
Size of the array of buckets.
FFFrameQueue: simple AVFrame queue API.
uint64_t total_samples_tail
Total number of samples dequeued from the queue.
size_t queued
Number of currently queued frames.
int samples_skipped
Indicate that samples are skipped.
Structure to hold global options and statistics for frame queues.
void ff_framequeue_global_init(FFFrameQueueGlobal *fqg)
Init a global structure.
AVFrame * ff_framequeue_peek(FFFrameQueue *fq, size_t idx)
Access a frame in the queue, without removing it.
void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base)
Skip samples from the first frame in the queue.
Rational number (pair of numerator and denominator).
uint64_t total_frames_head
Total number of frames entered in the queue.
Queue of AVFrame pointers.
size_t tail
Tail of the queue.
uint64_t total_samples_head
Total number of samples entered in the queue.
static uint64_t ff_framequeue_queued_samples(const FFFrameQueue *fq)
Get the number of queued samples.
void ff_framequeue_init(FFFrameQueue *fq, FFFrameQueueGlobal *fqg)
Init a frame queue and attach it to a global structure.
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
uint64_t total_frames_tail
Total number of frames dequeued from the queue.
static size_t ff_framequeue_queued_frames(const FFFrameQueue *fq)
Get the number of queued frames.
AVFrame * ff_framequeue_take(FFFrameQueue *fq)
Take the first frame in the queue.
Filter the word “frame” indicates either a video frame or a group of audio samples
void ff_framequeue_free(FFFrameQueue *fq)
Free the queue and all queued frames.
static void ff_framequeue_update_peeked(FFFrameQueue *fq, size_t idx)
Update the statistics after a frame accessed using ff_framequeue_peek() was modified.