Video frame pool
Video

## Macros

#define | GAVL_BAYER_GREEN_FIRST (1<<0)
#define | GAVL_BAYER_BLUE_LINE (1<<1)
#define | GAVL_BAYER_GBRG (GAVL_BAYER_GREEN_FIRST|GAVL_BAYER_BLUE_LINE)
#define | GAVL_BAYER_GRBG (GAVL_BAYER_GREEN_FIRST)
#define | GAVL_BAYER_BGGR (GAVL_BAYER_BLUE_LINE)
#define | GAVL_BAYER_RGGB 0

## Typedefs

typedef struct gavl_video_frame_pool_s | gavl_video_frame_pool_t
| Video frame pool.

## Functions

GAVL_PUBLIC gavl_video_frame_pool_t * | gavl_video_frame_pool_create (gavl_hw_context_t *hwctx)
| Create a video frame pool.
GAVL_PUBLIC gavl_video_frame_t * | gavl_video_frame_pool_get (gavl_video_frame_pool_t *p)
| Create a video frame pool.
GAVL_PUBLIC void | gavl_video_frame_pool_release (gavl_video_frame_t *frame)
GAVL_PUBLIC int | gavl_video_frame_pool_set_format (gavl_video_frame_pool_t *p, const gavl_video_format_t *fmt)
GAVL_PUBLIC const gavl_video_format_t * | gavl_video_frame_pool_get_format (const gavl_video_frame_pool_t *p)
GAVL_PUBLIC void | gavl_video_frame_pool_destroy (gavl_video_frame_pool_t *p)
| Destroy a video frame pool.
GAVL_PUBLIC void | gavl_video_frame_pool_reset (gavl_video_frame_pool_t *p)
| Reset a video frame pool.
GAVL_PUBLIC void | gavl_video_frame_debayer (gavl_video_options_t *opt, gavl_video_frame_t *src, gavl_video_frame_t *dst, int bayer_format, gavl_video_format_t *dst_format)

## 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_hw_context_t * | hwctx | ) |

Create a video frame pool.

Parameters

  create_frame | Function used to create one video frame
  priv | Private 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

  p | A 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

  p | A 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

  p | A frame pool

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