gavl
Typedefs | Functions
Video frame pool

Typedefs

typedef struct gavl_video_frame_pool_s gavl_video_frame_pool_t
 Video frame pool. More...
 

Functions

GAVL_PUBLIC gavl_video_frame_pool_tgavl_video_frame_pool_create (gavl_video_frame_t *(*create_frame)(void *priv), void *priv)
 Create a video frame pool. More...
 
GAVL_PUBLIC gavl_video_frame_tgavl_video_frame_pool_get (gavl_video_frame_pool_t *p)
 Create a video frame pool. More...
 
GAVL_PUBLIC void gavl_video_frame_pool_destroy (gavl_video_frame_pool_t *p)
 Destroy a video frame pool. More...
 
GAVL_PUBLIC void gavl_video_frame_pool_reset (gavl_video_frame_pool_t *p)
 Reset a video frame pool. More...
 

Detailed Description

This is used in scenarios where we want optimized video pipelines. Allocated frames can be passed forward or backwards in the pipeline while minimizing the memcpy operations.

The idea is to increment the refcount of a frame if an application intends to use a frame beyond an actual function call and decrement it when it's done with it.

The frame pool takes care of the refcounts and allocates frames on demand if necessary.

Typedef Documentation

◆ gavl_video_frame_pool_t

typedef struct gavl_video_frame_pool_s gavl_video_frame_pool_t

Video frame pool.

Since 1.5.0.

Function Documentation

◆ gavl_video_frame_pool_create()

GAVL_PUBLIC gavl_video_frame_pool_t* gavl_video_frame_pool_create ( gavl_video_frame_t *(*)(void *priv)  create_frame,
void *  priv 
)

Create a video frame pool.

Parameters
create_frameFunction used to create one video frame
privPrivate data to pass to create_frame
Returns
A video frame pool

◆ gavl_video_frame_pool_get()

GAVL_PUBLIC gavl_video_frame_t* gavl_video_frame_pool_get ( gavl_video_frame_pool_t p)

Create a video frame pool.

Parameters
pA frame pool
Returns
A video frame, either newly allocated or reused

◆ gavl_video_frame_pool_destroy()

GAVL_PUBLIC void gavl_video_frame_pool_destroy ( gavl_video_frame_pool_t p)

Destroy a video frame pool.

Parameters
pA frame pool

This also frees all frames, which were allocated by this frame pool.

◆ gavl_video_frame_pool_reset()

GAVL_PUBLIC void gavl_video_frame_pool_reset ( gavl_video_frame_pool_t p)

Reset a video frame pool.

Parameters
pA frame pool

Set the reference counters of all frames to zero. This is typically called before a seek operation in the stream.