FFmpeg
Data Structures | Macros | Functions
frame.c File Reference
#include "channel_layout.h"
#include "avassert.h"
#include "buffer.h"
#include "common.h"
#include "dict.h"
#include "frame.h"
#include "imgutils.h"
#include "mem.h"
#include "samplefmt.h"
#include "hwcontext.h"

Go to the source code of this file.

Data Structures

struct  qp_properties
 

Macros

#define CHECK_CHANNELS_CONSISTENCY(frame)
 

Functions

int av_frame_set_qp_table (AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
 
int8_t * av_frame_get_qp_table (AVFrame *f, int *stride, int *type)
 
const char * av_get_colorspace_name (enum AVColorSpace val)
 Get the name of a colorspace. More...
 
static void get_frame_defaults (AVFrame *frame)
 
static void free_side_data (AVFrameSideData **ptr_sd)
 
static void wipe_side_data (AVFrame *frame)
 
AVFrameav_frame_alloc (void)
 Allocate an AVFrame and set its fields to default values. More...
 
void av_frame_free (AVFrame **frame)
 Free the frame and any dynamically allocated objects in it, e.g. More...
 
static int get_video_buffer (AVFrame *frame, int align)
 
static int get_audio_buffer (AVFrame *frame, int align)
 
int av_frame_get_buffer (AVFrame *frame, int align)
 Allocate new buffer(s) for audio or video data. More...
 
static int frame_copy_props (AVFrame *dst, const AVFrame *src, int force_copy)
 
int av_frame_ref (AVFrame *dst, const AVFrame *src)
 Set up a new reference to the data described by the source frame. More...
 
AVFrameav_frame_clone (const AVFrame *src)
 Create a new frame that references the same data as src. More...
 
void av_frame_unref (AVFrame *frame)
 Unreference all the buffers referenced by frame and reset the frame fields. More...
 
void av_frame_move_ref (AVFrame *dst, AVFrame *src)
 Move everything contained in src to dst and reset src. More...
 
int av_frame_is_writable (AVFrame *frame)
 Check if the frame data is writable. More...
 
int av_frame_make_writable (AVFrame *frame)
 Ensure that the frame data is writable, avoiding data copy if possible. More...
 
int av_frame_copy_props (AVFrame *dst, const AVFrame *src)
 Copy only "metadata" fields from src to dst. More...
 
AVBufferRefav_frame_get_plane_buffer (AVFrame *frame, int plane)
 Get the buffer reference a given data plane is stored in. More...
 
AVFrameSideDataav_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. More...
 
AVFrameSideDataav_frame_new_side_data (AVFrame *frame, enum AVFrameSideDataType type, buffer_size_t size)
 Add a new side data to a frame. More...
 
AVFrameSideDataav_frame_get_side_data (const AVFrame *frame, enum AVFrameSideDataType type)
 
static int frame_copy_video (AVFrame *dst, const AVFrame *src)
 
static int frame_copy_audio (AVFrame *dst, const AVFrame *src)
 
int av_frame_copy (AVFrame *dst, const AVFrame *src)
 Copy the frame data from src to dst. More...
 
void av_frame_remove_side_data (AVFrame *frame, enum AVFrameSideDataType type)
 Remove and free all side data instances of the given type. More...
 
const char * av_frame_side_data_name (enum AVFrameSideDataType type)
 
static int calc_cropping_offsets (size_t offsets[4], const AVFrame *frame, const AVPixFmtDescriptor *desc)
 
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. More...
 

Macro Definition Documentation

◆ CHECK_CHANNELS_CONSISTENCY

#define CHECK_CHANNELS_CONSISTENCY (   frame)
Value:
av_assert2(!(frame)->channel_layout || \
(frame)->channels == \

Definition at line 44 of file frame.c.

Function Documentation

◆ get_frame_defaults()

static void get_frame_defaults ( AVFrame frame)
static

Definition at line 139 of file frame.c.

Referenced by av_frame_alloc(), av_frame_move_ref(), and av_frame_unref().

◆ free_side_data()

static void free_side_data ( AVFrameSideData **  ptr_sd)
static

Definition at line 169 of file frame.c.

Referenced by av_frame_remove_side_data(), and wipe_side_data().

◆ wipe_side_data()

static void wipe_side_data ( AVFrame frame)
static

Definition at line 178 of file frame.c.

Referenced by av_frame_unref(), and frame_copy_props().

◆ get_video_buffer()

static int get_video_buffer ( AVFrame frame,
int  align 
)
static

Definition at line 212 of file frame.c.

Referenced by av_frame_get_buffer().

◆ get_audio_buffer()

static int get_audio_buffer ( AVFrame frame,
int  align 
)
static

Definition at line 281 of file frame.c.

Referenced by av_frame_get_buffer().

◆ frame_copy_props()

static int frame_copy_props ( AVFrame dst,
const AVFrame src,
int  force_copy 
)
static

Definition at line 350 of file frame.c.

Referenced by av_frame_copy_props(), and av_frame_ref().

◆ frame_copy_video()

static int frame_copy_video ( AVFrame dst,
const AVFrame src 
)
static

Definition at line 750 of file frame.c.

Referenced by av_frame_copy().

◆ frame_copy_audio()

static int frame_copy_audio ( AVFrame dst,
const AVFrame src 
)
static

Definition at line 775 of file frame.c.

Referenced by av_frame_copy().

◆ calc_cropping_offsets()

static int calc_cropping_offsets ( size_t  offsets[4],
const AVFrame frame,
const AVPixFmtDescriptor desc 
)
static

Definition at line 859 of file frame.c.

Referenced by av_frame_apply_cropping().

channels
channels
Definition: aptx.h:33
av_get_channel_layout_nb_channels
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
Definition: channel_layout.c:226
av_assert2
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:64
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264