FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
framequeue.h File Reference
#include "libavutil/frame.h"

Go to the source code of this file.

Data Structures

struct  FFFrameBucket
 FFFrameQueue: simple AVFrame queue API. More...
 
struct  FFFrameQueueGlobal
 Structure to hold global options and statistics for frame queues. More...
 
struct  FFFrameQueue
 Queue of AVFrame pointers. More...
 

Functions

void ff_framequeue_global_init (FFFrameQueueGlobal *fqg)
 Init a global structure. More...
 
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...
 
static size_t ff_framequeue_queued_frames (const FFFrameQueue *fq)
 Get the number of queued frames. More...
 
static uint64_t ff_framequeue_queued_samples (const FFFrameQueue *fq)
 Get the number of queued samples. More...
 
static void ff_framequeue_update_peeked (FFFrameQueue *fq, size_t idx)
 Update the statistics after a frame accessed using ff_framequeue_peek() was modified. 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

void ff_framequeue_global_init ( FFFrameQueueGlobal fqg)

Init a global structure.

Definition at line 30 of file framequeue.c.

Referenced by avfilter_graph_alloc().

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().

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().

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().

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 ff_framequeue_free(), ff_inlink_consume_frame(), ff_inlink_set_status(), and take_samples().

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().

static size_t ff_framequeue_queued_frames ( const FFFrameQueue fq)
inlinestatic
static uint64_t ff_framequeue_queued_samples ( const FFFrameQueue fq)
inlinestatic

Get the number of queued samples.

Definition at line 154 of file framequeue.h.

Referenced by activate(), ff_inlink_check_available_samples(), ff_inlink_consume_samples(), ff_inlink_queued_samples(), and samples_ready().

static void ff_framequeue_update_peeked ( FFFrameQueue fq,
size_t  idx 
)
inlinestatic

Update the statistics after a frame accessed using ff_framequeue_peek() was modified.

Currently used only as a marker.

Definition at line 164 of file framequeue.h.

Referenced by 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().