FFmpeg
Functions
framequeue.c File Reference
#include "libavutil/avassert.h"
#include "framequeue.h"

Go to the source code of this file.

Functions

static FFFrameBucketbucket (FFFrameQueue *fq, size_t idx)
 
void ff_framequeue_global_init (FFFrameQueueGlobal *fqg)
 Init a global structure. More...
 
static void check_consistency (FFFrameQueue *fq)
 
void ff_framequeue_init (FFFrameQueue *fq, FFFrameQueueGlobal *fqg)
 Init a frame queue and attach it to a global structure. More...
 
void ff_framequeue_free (FFFrameQueue *fq)
 Free the queue and all queued frames. More...
 
int ff_framequeue_add (FFFrameQueue *fq, AVFrame *frame)
 Add a frame. More...
 
AVFrameff_framequeue_take (FFFrameQueue *fq)
 Take the first frame in the queue. More...
 
AVFrameff_framequeue_peek (FFFrameQueue *fq, size_t idx)
 Access a frame in the queue, without removing it. More...
 
void ff_framequeue_skip_samples (FFFrameQueue *fq, size_t samples, AVRational time_base)
 Skip samples from the first frame in the queue. More...
 

Function Documentation

◆ bucket()

static FFFrameBucket* bucket ( FFFrameQueue fq,
size_t  idx 
)
inlinestatic

◆ ff_framequeue_global_init()

void ff_framequeue_global_init ( FFFrameQueueGlobal fqg)

Init a global structure.

Definition at line 30 of file framequeue.c.

Referenced by avfilter_graph_alloc(), and deshake_opencl_init().

◆ check_consistency()

static void check_consistency ( FFFrameQueue fq)
static

◆ ff_framequeue_init()

void ff_framequeue_init ( FFFrameQueue fq,
FFFrameQueueGlobal fqg 
)

Init a frame queue and attach it to a global structure.

Definition at line 47 of file framequeue.c.

Referenced by avfilter_link(), and deshake_opencl_init().

◆ ff_framequeue_free()

void ff_framequeue_free ( FFFrameQueue fq)

Free the queue and all queued frames.

Definition at line 53 of file framequeue.c.

Referenced by avfilter_link_free(), and deshake_opencl_uninit().

◆ ff_framequeue_add()

int ff_framequeue_add ( FFFrameQueue fq,
AVFrame frame 
)

Add a frame.

Returns
>=0 or an AVERROR code.

Definition at line 63 of file framequeue.c.

Referenced by ff_filter_frame().

◆ ff_framequeue_take()

AVFrame* ff_framequeue_take ( FFFrameQueue fq)

Take the first frame in the queue.

Must not be used with empty queues.

Definition at line 98 of file framequeue.c.

Referenced by activate(), ff_framequeue_free(), ff_inlink_consume_frame(), ff_inlink_set_status(), and take_samples().

◆ ff_framequeue_peek()

AVFrame* ff_framequeue_peek ( FFFrameQueue fq,
size_t  idx 
)

Access a frame in the queue, without removing it.

The first frame is numbered 0; the designated frame must exist.

Definition at line 115 of file framequeue.c.

Referenced by ff_inlink_consume_frame(), ff_inlink_peek_frame(), and take_samples().

◆ ff_framequeue_skip_samples()

void ff_framequeue_skip_samples ( FFFrameQueue fq,
size_t  samples,
AVRational  time_base 
)

Skip samples from the first frame in the queue.

This function must be used when the first frame was accessed using ff_framequeue_peek() and samples were consumed from it. It adapts the data pointers and timestamps of the head frame to account for the skipped samples.

Definition at line 126 of file framequeue.c.

Referenced by take_samples().