Loading...
Searching...
No Matches
frame.h File Reference
libavutil » Data Structures » AVFrame

reference-counted frame API More...

`#include <stddef.h>`
`#include <stdint.h>`
`#include "avutil.h"`
`#include "buffer.h"`
`#include "channel_layout.h"`
`#include "dict.h"`
`#include "rational.h"`
`#include "samplefmt.h"`
`#include "pixfmt.h"`
`#include "version.h"`

Go to the source code of this file.

## Data Structures

struct | AVFrameSideData
| Structure to hold side data for an AVFrame. More...
struct | AVSideDataDescriptor
| This struct describes the properties of a side data type. More...
struct | AVRegionOfInterest
| Structure describing a single Region Of Interest. More...
struct | AVFrame
| This structure describes decoded (raw) audio or video data. More...

## Macros

#define | AV_NUM_DATA_POINTERS 8
#define | AV_FRAME_FLAG_CORRUPT (1 << 0)
| The frame data may be corrupted, e.g.
#define | AV_FRAME_FLAG_KEY (1 << 1)
| A flag to mark frames that are keyframes.
#define | AV_FRAME_FLAG_DISCARD (1 << 2)
| A flag to mark the frames which need to be decoded, but shouldn't be output.
#define | AV_FRAME_FLAG_INTERLACED (1 << 3)
| A flag to mark frames whose content is interlaced.
#define | AV_FRAME_FLAG_TOP_FIELD_FIRST (1 << 4)
| A flag to mark frames where the top field is displayed first if the content is interlaced.
#define | AV_FRAME_FLAG_LOSSLESS (1 << 5)
| A decoder can use this flag to mark frames which were originally encoded losslessly.
#define | FF_DECODE_ERROR_INVALID_BITSTREAM 1
#define | FF_DECODE_ERROR_MISSING_REFERENCE 2
#define | FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
#define | FF_DECODE_ERROR_DECODE_SLICES 8
#define | AV_FRAME_SIDE_DATA_FLAG_UNIQUE (1 << 0)
| Remove existing entries before adding new ones.
#define | AV_FRAME_SIDE_DATA_FLAG_REPLACE (1 << 1)
| Don't add a new entry if another of the same type exists.
#define | AV_FRAME_SIDE_DATA_FLAG_NEW_REF (1 << 2)
| Create a new reference to the passed in buffer instead of taking ownership of it.

## Enumerations

enum

AVFrameSideDataType {
AV_FRAME_DATA_PANSCAN , AV_FRAME_DATA_A53_CC , AV_FRAME_DATA_STEREO3D , AV_FRAME_DATA_MATRIXENCODING ,
AV_FRAME_DATA_DOWNMIX_INFO , AV_FRAME_DATA_REPLAYGAIN , AV_FRAME_DATA_DISPLAYMATRIX , AV_FRAME_DATA_AFD ,
AV_FRAME_DATA_MOTION_VECTORS , AV_FRAME_DATA_SKIP_SAMPLES , AV_FRAME_DATA_AUDIO_SERVICE_TYPE , AV_FRAME_DATA_MASTERING_DISPLAY_METADATA ,
AV_FRAME_DATA_GOP_TIMECODE , AV_FRAME_DATA_SPHERICAL , AV_FRAME_DATA_CONTENT_LIGHT_LEVEL , AV_FRAME_DATA_ICC_PROFILE ,
AV_FRAME_DATA_S12M_TIMECODE , AV_FRAME_DATA_DYNAMIC_HDR_PLUS , AV_FRAME_DATA_REGIONS_OF_INTEREST , AV_FRAME_DATA_VIDEO_ENC_PARAMS ,
AV_FRAME_DATA_SEI_UNREGISTERED , AV_FRAME_DATA_FILM_GRAIN_PARAMS , AV_FRAME_DATA_DETECTION_BBOXES , AV_FRAME_DATA_DOVI_RPU_BUFFER ,
AV_FRAME_DATA_DOVI_METADATA , AV_FRAME_DATA_DYNAMIC_HDR_VIVID , AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT , AV_FRAME_DATA_VIDEO_HINT ,
AV_FRAME_DATA_LCEVC , AV_FRAME_DATA_VIEW_ID , AV_FRAME_DATA_3D_REFERENCE_DISPLAYS
}

enum | AVActiveFormatDescription { AV_AFD_SAME = 8 , AV_AFD_4_3 = 9 , AV_AFD_16_9 = 10 , AV_AFD_14_9 = 11 , AV_AFD_4_3_SP_14_9 = 13 , AV_AFD_16_9_SP_14_9 = 14 , AV_AFD_SP_4_3 = 15 }
enum | AVSideDataProps { AV_SIDE_DATA_PROP_GLOBAL = (1 << 0) , AV_SIDE_DATA_PROP_MULTI = (1 << 1) , AV_SIDE_DATA_PROP_SIZE_DEPENDENT = (1 << 2) , AV_SIDE_DATA_PROP_COLOR_DEPENDENT = (1 << 3) , AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT = (1 << 4) }
enum | { AV_FRAME_CROP_UNALIGNED = 1 << 0 }
| Flags for frame cropping. More...

## Functions

AVFrame * | av_frame_alloc (void)
| Allocate an AVFrame and set its fields to default values.
void | av_frame_free (AVFrame **frame)
| Free the frame and any dynamically allocated objects in it, e.g.
int | av_frame_ref (AVFrame *dst, const AVFrame *src)
| Set up a new reference to the data described by the source frame.
int | av_frame_replace (AVFrame *dst, const AVFrame *src)
| Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty.
AVFrame * | av_frame_clone (const AVFrame *src)
| Create a new frame that references the same data as src.
void | av_frame_unref (AVFrame *frame)
| Unreference all the buffers referenced by frame and reset the frame fields.
void | av_frame_move_ref (AVFrame *dst, AVFrame *src)
| Move everything contained in src to dst and reset src.
int | av_frame_get_buffer (AVFrame *frame, int align)
| Allocate new buffer(s) for audio or video data.
int | av_frame_is_writable (AVFrame *frame)
| Check if the frame data is writable.
int | av_frame_make_writable (AVFrame *frame)
| Ensure that the frame data is writable, avoiding data copy if possible.
int | av_frame_copy (AVFrame *dst, const AVFrame *src)
| Copy the frame data from src to dst.
int | av_frame_copy_props (AVFrame *dst, const AVFrame *src)
| Copy only "metadata" fields from src to dst.
AVBufferRef * | av_frame_get_plane_buffer (const AVFrame *frame, int plane)
| Get the buffer reference a given data plane is stored in.
AVFrameSideData * | av_frame_new_side_data (AVFrame *frame, enum AVFrameSideDataType type, size_t size)
| Add a new side data to a frame.
AVFrameSideData * | av_frame_new_side_data_from_buf (AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef *buf)
| Add a new side data to a frame from an existing AVBufferRef.
AVFrameSideData * | av_frame_get_side_data (const AVFrame *frame, enum AVFrameSideDataType type)
void | av_frame_remove_side_data (AVFrame *frame, enum AVFrameSideDataType type)
| Remove and free all side data instances of the given type.
int | av_frame_apply_cropping (AVFrame *frame, int flags)
| Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields.
const char * | av_frame_side_data_name (enum AVFrameSideDataType type)
const AVSideDataDescriptor * | av_frame_side_data_desc (enum AVFrameSideDataType type)
void | av_frame_side_data_free (AVFrameSideData ***sd, int *nb_sd)
| Free all side data entries and their contents, then zeroes out the values which the pointers are pointing to.
AVFrameSideData * | av_frame_side_data_new (AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, size_t size, unsigned int flags)
| Add new side data entry to an array.
AVFrameSideData * | av_frame_side_data_add (AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, AVBufferRef **buf, unsigned int flags)
| Add a new side data entry to an array from an existing AVBufferRef.
int | av_frame_side_data_clone (AVFrameSideData ***sd, int *nb_sd, const AVFrameSideData *src, unsigned int flags)
| Add a new side data entry to an array based on existing side data, taking a reference towards the contained AVBufferRef.
const AVFrameSideData * | av_frame_side_data_get_c (const AVFrameSideData *const *sd, const int nb_sd, enum AVFrameSideDataType type)
| Get a side data entry of a specific type from an array.
static const AVFrameSideData * | av_frame_side_data_get (AVFrameSideData *const *sd, const int nb_sd, enum AVFrameSideDataType type)
| Wrapper around av_frame_side_data_get_c() to workaround the limitation that for any type T the conversion from T * const * to const T * const * is not performed automatically in C.
void | av_frame_side_data_remove (AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type)
| Remove and free all side data instances of the given type from an array.
void | av_frame_side_data_remove_by_props (AVFrameSideData ***sd, int *nb_sd, int props)
| Remove and free all side data instances that match any of the given side data properties.

## Detailed Description

reference-counted frame API

Definition in file frame.h.

## Macro Definition Documentation

## AV_NUM_DATA_POINTERS

#define AV_NUM_DATA_POINTERS 8

Definition at line 422 of file frame.h.

Referenced by avcodec_align_dimensions2().

## FF_DECODE_ERROR_INVALID_BITSTREAM

#define FF_DECODE_ERROR_INVALID_BITSTREAM 1

Definition at line 709 of file frame.h.

## FF_DECODE_ERROR_MISSING_REFERENCE

#define FF_DECODE_ERROR_MISSING_REFERENCE 2

Definition at line 710 of file frame.h.

## FF_DECODE_ERROR_CONCEALMENT_ACTIVE

#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4

Definition at line 711 of file frame.h.

## FF_DECODE_ERROR_DECODE_SLICES

#define FF_DECODE_ERROR_DECODE_SLICES 8

Definition at line 712 of file frame.h.