FFmpeg
Modules | Files | Data Structures | Enumerations | Functions

Modules

 AV_FRAME_FLAGS
 

Files

file  frame.h
 

Data Structures

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

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_QP_TABLE_PROPERTIES, AV_FRAME_DATA_QP_TABLE_DATA, AV_FRAME_DATA_S12M_TIMECODE, AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
  AV_FRAME_DATA_REGIONS_OF_INTEREST
}
 
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  { AV_FRAME_CROP_UNALIGNED = 1 << 0 }
 Flags for frame cropping. More...
 

Functions

attribute_deprecated int64_t av_frame_get_best_effort_timestamp (const AVFrame *frame)
 Accessors for some AVFrame fields. More...
 
attribute_deprecated void av_frame_set_best_effort_timestamp (AVFrame *frame, int64_t val)
 
attribute_deprecated int64_t av_frame_get_pkt_duration (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_pkt_duration (AVFrame *frame, int64_t val)
 
attribute_deprecated int64_t av_frame_get_pkt_pos (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_pkt_pos (AVFrame *frame, int64_t val)
 
attribute_deprecated int64_t av_frame_get_channel_layout (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_channel_layout (AVFrame *frame, int64_t val)
 
attribute_deprecated int av_frame_get_channels (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_channels (AVFrame *frame, int val)
 
attribute_deprecated int av_frame_get_sample_rate (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_sample_rate (AVFrame *frame, int val)
 
attribute_deprecated AVDictionaryav_frame_get_metadata (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_metadata (AVFrame *frame, AVDictionary *val)
 
attribute_deprecated int av_frame_get_decode_error_flags (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_decode_error_flags (AVFrame *frame, int val)
 
attribute_deprecated int av_frame_get_pkt_size (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_pkt_size (AVFrame *frame, int val)
 
attribute_deprecated int8_t * av_frame_get_qp_table (AVFrame *f, int *stride, int *type)
 
attribute_deprecated int av_frame_set_qp_table (AVFrame *f, AVBufferRef *buf, int stride, int type)
 
attribute_deprecated enum AVColorSpace av_frame_get_colorspace (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_colorspace (AVFrame *frame, enum AVColorSpace val)
 
attribute_deprecated enum AVColorRange av_frame_get_color_range (const AVFrame *frame)
 
attribute_deprecated void av_frame_set_color_range (AVFrame *frame, enum AVColorRange val)
 
const char * av_get_colorspace_name (enum AVColorSpace val)
 Get the name of a colorspace. More...
 
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...
 
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_get_buffer (AVFrame *frame, int align)
 Allocate new buffer(s) for audio or video data. 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 (AVFrame *dst, const AVFrame *src)
 Copy the frame data from src to dst. 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 (AVFrame *frame, enum AVFrameSideDataType type, int size)
 Add a new side data to a frame. 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_get_side_data (const AVFrame *frame, enum AVFrameSideDataType type)
 
void av_frame_remove_side_data (AVFrame *frame, enum AVFrameSideDataType type)
 If side data of the supplied type exists in the frame, free it and remove it from the frame. More...
 
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...
 
const char * av_frame_side_data_name (enum AVFrameSideDataType type)
 

Detailed Description

AVFrame is an abstraction for reference-counted raw multimedia data.

Enumeration Type Documentation

◆ AVFrameSideDataType

Enumerator
AV_FRAME_DATA_PANSCAN 

The data is the AVPanScan struct defined in libavcodec.

AV_FRAME_DATA_A53_CC 

ATSC A53 Part 4 Closed Captions.

A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. The number of bytes of CC data is AVFrameSideData.size.

AV_FRAME_DATA_STEREO3D 

Stereoscopic 3d metadata.

The data is the AVStereo3D struct defined in libavutil/stereo3d.h.

AV_FRAME_DATA_MATRIXENCODING 

The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.

AV_FRAME_DATA_DOWNMIX_INFO 

Metadata relevant to a downmix procedure.

The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h.

AV_FRAME_DATA_REPLAYGAIN 

ReplayGain information in the form of the AVReplayGain struct.

AV_FRAME_DATA_DISPLAYMATRIX 

This side data contains a 3x3 transformation matrix describing an affine transformation that needs to be applied to the frame for correct presentation.

See libavutil/display.h for a detailed description of the data.

AV_FRAME_DATA_AFD 

Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVActiveFormatDescription enum.

AV_FRAME_DATA_MOTION_VECTORS 

Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec AVCodecContext flags2 option).

The data is the AVMotionVector struct defined in libavutil/motion_vector.h.

AV_FRAME_DATA_SKIP_SAMPLES 

Recommmends skipping the specified number of samples.

This is exported only if the "skip_manual" AVOption is set in libavcodec. This has the same format as AV_PKT_DATA_SKIP_SAMPLES.

u32le number of samples to skip from start of this packet
u32le number of samples to skip from end of this packet
u8 reason for start skip
u8 reason for end skip (0=padding silence, 1=convergence)
AV_FRAME_DATA_AUDIO_SERVICE_TYPE 

This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defined in avcodec.h.

AV_FRAME_DATA_MASTERING_DISPLAY_METADATA 

Mastering display metadata associated with a video frame.

The payload is an AVMasteringDisplayMetadata type and contains information about the mastering display color volume.

AV_FRAME_DATA_GOP_TIMECODE 

The GOP timecode in 25 bit timecode format.

Data format is 64-bit integer. This is set on the first frame of a GOP that has a temporal reference of 0.

AV_FRAME_DATA_SPHERICAL 

The data represents the AVSphericalMapping structure defined in libavutil/spherical.h.

AV_FRAME_DATA_CONTENT_LIGHT_LEVEL 

Content light level (based on CTA-861.3).

This payload contains data in the form of the AVContentLightMetadata struct.

AV_FRAME_DATA_ICC_PROFILE 

The data contains an ICC profile as an opaque octet buffer following the format described by ISO 15076-1 with an optional name defined in the metadata key entry "name".

AV_FRAME_DATA_QP_TABLE_PROPERTIES 

Implementation-specific description of the format of AV_FRAME_QP_TABLE_DATA.

The contents of this side data are undocumented and internal; use av_frame_set_qp_table() and av_frame_get_qp_table() to access this in a meaningful way instead.

AV_FRAME_DATA_QP_TABLE_DATA 

Raw QP table data.

Its format is described by AV_FRAME_DATA_QP_TABLE_PROPERTIES. Use av_frame_set_qp_table() and av_frame_get_qp_table() to access this instead.

AV_FRAME_DATA_S12M_TIMECODE 

Timecode which conforms to SMPTE ST 12-1.

The data is an array of 4 uint32_t where the first uint32_t describes how many (1-3) of the other timecodes are used. The timecode format is described in the av_timecode_get_smpte_from_framenum() function in libavutil/timecode.c.

AV_FRAME_DATA_DYNAMIC_HDR_PLUS 

HDR dynamic metadata associated with a video frame.

The payload is an AVDynamicHDRPlus type and contains information for color volume transform - application 4 of SMPTE 2094-40:2016 standard.

AV_FRAME_DATA_REGIONS_OF_INTEREST 

Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is implied by AVFrameSideData.size / AVRegionOfInterest.self_size.

Definition at line 48 of file frame.h.

◆ AVActiveFormatDescription

Enumerator
AV_AFD_SAME 
AV_AFD_4_3 
AV_AFD_16_9 
AV_AFD_14_9 
AV_AFD_4_3_SP_14_9 
AV_AFD_16_9_SP_14_9 
AV_AFD_SP_4_3 

Definition at line 184 of file frame.h.

◆ anonymous enum

anonymous enum

Flags for frame cropping.

Enumerator
AV_FRAME_CROP_UNALIGNED 

Apply the maximum possible cropping, even if it requires setting the AVFrame.data[] entries to unaligned pointers.

Passing unaligned data to FFmpeg API is generally not allowed, and causes undefined behavior (such as crashes). You can pass unaligned data only to FFmpeg APIs that are explicitly documented to accept it. Use this flag only if you absolutely know what you are doing.

Definition at line 932 of file frame.h.

Function Documentation

◆ av_frame_get_best_effort_timestamp()

attribute_deprecated int64_t av_frame_get_best_effort_timestamp ( const AVFrame frame)

Accessors for some AVFrame fields.

These used to be provided for ABI compatibility, and do not need to be used anymore.

◆ av_frame_set_best_effort_timestamp()

attribute_deprecated void av_frame_set_best_effort_timestamp ( AVFrame frame,
int64_t  val 
)

◆ av_frame_get_pkt_duration()

attribute_deprecated int64_t av_frame_get_pkt_duration ( const AVFrame frame)

◆ av_frame_set_pkt_duration()

attribute_deprecated void av_frame_set_pkt_duration ( AVFrame frame,
int64_t  val 
)

◆ av_frame_get_pkt_pos()

attribute_deprecated int64_t av_frame_get_pkt_pos ( const AVFrame frame)

◆ av_frame_set_pkt_pos()

attribute_deprecated void av_frame_set_pkt_pos ( AVFrame frame,
int64_t  val 
)

◆ av_frame_get_channel_layout()

attribute_deprecated int64_t av_frame_get_channel_layout ( const AVFrame frame)

◆ av_frame_set_channel_layout()

attribute_deprecated void av_frame_set_channel_layout ( AVFrame frame,
int64_t  val 
)

◆ av_frame_get_channels()

attribute_deprecated int av_frame_get_channels ( const AVFrame frame)

◆ av_frame_set_channels()

attribute_deprecated void av_frame_set_channels ( AVFrame frame,
int  val 
)

◆ av_frame_get_sample_rate()

attribute_deprecated int av_frame_get_sample_rate ( const AVFrame frame)

◆ av_frame_set_sample_rate()

attribute_deprecated void av_frame_set_sample_rate ( AVFrame frame,
int  val 
)

◆ av_frame_get_metadata()

attribute_deprecated AVDictionary* av_frame_get_metadata ( const AVFrame frame)

◆ av_frame_set_metadata()

attribute_deprecated void av_frame_set_metadata ( AVFrame frame,
AVDictionary val 
)

◆ av_frame_get_decode_error_flags()

attribute_deprecated int av_frame_get_decode_error_flags ( const AVFrame frame)

◆ av_frame_set_decode_error_flags()

attribute_deprecated void av_frame_set_decode_error_flags ( AVFrame frame,
int  val 
)

◆ av_frame_get_pkt_size()

attribute_deprecated int av_frame_get_pkt_size ( const AVFrame frame)

◆ av_frame_set_pkt_size()

attribute_deprecated void av_frame_set_pkt_size ( AVFrame frame,
int  val 
)

◆ av_frame_get_qp_table()

attribute_deprecated int8_t* av_frame_get_qp_table ( AVFrame f,
int stride,
int type 
)

Definition at line 90 of file frame.c.

Referenced by filter_frame(), and pp_filter_frame().

◆ av_frame_set_qp_table()

attribute_deprecated int av_frame_set_qp_table ( AVFrame f,
AVBufferRef buf,
int  stride,
int  type 
)

Definition at line 54 of file frame.c.

Referenced by ff_mjpeg_decode_frame(), ff_mpv_export_qp_table(), and filter_frame().

◆ av_frame_get_colorspace()

attribute_deprecated enum AVColorSpace av_frame_get_colorspace ( const AVFrame frame)

◆ av_frame_set_colorspace()

attribute_deprecated void av_frame_set_colorspace ( AVFrame frame,
enum AVColorSpace  val 
)

◆ av_frame_get_color_range()

attribute_deprecated enum AVColorRange av_frame_get_color_range ( const AVFrame frame)

◆ av_frame_set_color_range()

attribute_deprecated void av_frame_set_color_range ( AVFrame frame,
enum AVColorRange  val 
)

◆ av_get_colorspace_name()

const char* av_get_colorspace_name ( enum AVColorSpace  val)

Get the name of a colorspace.

Returns
a static string identifying the colorspace; can be NULL.

Definition at line 122 of file frame.c.

Referenced by avcodec_string().

◆ av_frame_alloc()

AVFrame* av_frame_alloc ( void  )

Allocate an AVFrame and set its fields to default values.

The resulting struct must be freed using av_frame_free().

Returns
An AVFrame filled with default values or NULL on failure.
Note
this only allocates the AVFrame itself, not the data buffers. Those must be allocated through other means, e.g. with av_frame_get_buffer() or manually.

Definition at line 189 of file frame.c.

Referenced by aasc_decode_init(), alloc_audio_frame(), alloc_frame(), alloc_frame_empty(), alloc_picture(), amf_load_library(), apng_encode_frame(), audio_thread(), av_buffersrc_add_frame_flags(), av_buffersrc_add_frame_internal(), av_frame_clone(), av_hwframe_get_buffer(), avcodec_encode_audio2(), avcodec_open2(), avs_decode_init(), bethsoftvid_decode_init(), cdg_decode_init(), cinepak_decode_init(), cinepak_encode_init(), cinvideo_decode_init(), clv_decode_init(), cmv_decode_init(), config_input(), config_output(), cpia_decode_init(), cudascale_filter_frame(), cudascale_init(), cuvid_output_frame(), dec_enc(), decode_audio(), decode_entropy_coded_image(), decode_init(), decode_video(), decode_write(), dirac_decode_init(), do_video_out(), downscale(), drm_transfer_data_from(), drm_transfer_data_to(), dxva2_transfer_data_from(), dxva2_transfer_data_to(), encode_apng(), encode_frame(), encode_init(), escape124_decode_init(), ff_cavs_init(), ff_default_get_video_buffer(), ff_ffv1_common_init(), ff_frame_pool_get(), ff_frame_thread_init(), ff_hwframe_map_create(), ff_libwebp_get_frame(), ff_load_image(), ff_mjpeg_decode_init(), ff_mpv_common_init(), ff_mpv_encode_init(), ff_thread_video_encode_frame(), ff_vaapi_encode_send_frame(), ff_vp56_init_context(), ffat_init_encoder(), fic_decode_init(), filter_encode_write_frame(), flashsv_decode_init(), flic_decode_init(), frame_queue_init(), get_free_frame(), get_surface(), gif_decode_init(), gif_encode_frame(), h264_init_context(), hevc_init_context(), hwaccel_retrieve_data(), hwframe_pool_prealloc(), hwmap_filter_frame(), hwmap_get_buffer(), init(), init_axis_from_file(), init_axis_from_font(), init_frames(), init_input_frame(), init_output_frame(), ipvideo_decode_init(), ir2_decode_init(), kmsgrab_read_packet(), lavfi_read_header(), LLVMFuzzerTestOneInput(), main(), mca(), mimic_decode_init(), mm_decode_init(), movie_push_frame(), mp_decode_init(), msrle_decode_init(), mss1_decode_init(), mss2_decode_init(), mss3_decode_init(), mss4_decode_init(), msvideo1_decode_init(), mxpeg_decode_init(), nppscale_filter_frame(), nppscale_init(), npptranspose_filter_frame(), npptranspose_init(), nvenc_alloc_surface(), pad_last_frame(), paf_video_init(), png_dec_init(), qsv_frame_lock(), qsv_map_from(), qsv_transfer_data_child(), qtrle_decode_init(), qtrle_encode_init(), query_frame(), read_interval_packets(), read_packet_vs(), reap_filters(), reget_buffer_internal(), roq_decode_init(), roq_encode_init(), rpza_decode_init(), rscc_init(), run_test(), screenpresso_init(), seek_test(), sender_thread(), seqvideo_decode_init(), smc_decode_init(), smvjpeg_decode_init(), spawn_empty_frame(), sub2video_prepare(), svq1_decode_init(), svq1_encode_init(), svq3_decode_init(), tdsc_init(), tgv_decode_init(), transfer_data_alloc(), truemotion1_decode_init(), try_decode_frame(), try_decode_video_frame(), try_push_frame(), tscc2_decode_init(), ulti_decode_init(), vaapi_encode_issue(), vaapi_transfer_data_from(), vaapi_transfer_data_to(), vc1_decode_init(), video_decode(), video_decode_example(), video_thread(), videotoolbox_init(), vmdvideo_decode_init(), vp8_init_frames(), vp8_lossy_decode_alpha(), vt_transfer_data_from(), vt_transfer_data_to(), xan_decode_init(), xma_decode_init(), xvid_encode_init(), yop_decode_init(), and zerocodec_decode_init().

◆ av_frame_free()

void av_frame_free ( AVFrame **  frame)

Free the frame and any dynamically allocated objects in it, e.g.

extended_data. If the frame is reference counted, it will be unreferenced first.

Parameters
frameframe to be freed. The pointer will be set to NULL.

Definition at line 202 of file frame.c.

Referenced by aasc_decode_end(), activate(), add_to_queue(), alloc_frame(), alloc_frame_empty(), amf_release_buffer_with_frame_ref(), apng_encode_frame(), apply_lut(), apply_palette(), audio_thread(), av_buffersrc_add_frame_flags(), av_buffersrc_add_frame_internal(), av_frame_clone(), av_hwframe_get_buffer(), avcodec_close(), avcodec_encode_audio2(), avcodec_open2(), avfilter_link_free(), avgblur_opencl_filter_frame(), avs_decode_end(), bethsoftvid_decode_end(), blend_frame(), cdg_decode_end(), celt_frame_setup_input(), channelmap_filter_frame(), cinepak_decode_end(), cinepak_encode_end(), cinepak_encode_init(), cinvideo_decode_end(), clear_frame_list(), clear_unused_frames(), close_stream(), clv_decode_end(), cmv_decode_end(), cmv_decode_init(), common_uninit(), compand_delay(), compand_nodelay(), config_input(), config_output(), config_video(), config_video_output(), configure_filtergraph(), convert_coeffs(), convolution_opencl_filter_frame(), copy_context_reset(), cpia_decode_end(), cudascale_filter_frame(), cudascale_uninit(), cudaupload_filter_frame(), cuvid_output_frame(), dec_enc(), decimate_uninit(), decklink_write_video_packet(), decode_close(), decode_end(), decode_init(), decode_write(), deint_cuda_uninit(), deint_vaapi_filter_frame(), deint_vaapi_pipeline_uninit(), dirac_decode_end(), dirac_decode_init(), do_video_out(), downscale(), drm_transfer_data_from(), drm_transfer_data_to(), dxva2_transfer_data_from(), dxva2_transfer_data_to(), empty_buffer_done(), encode_apng(), encode_end(), encode_frame(), encode_write_frame(), end_last_frame(), escape124_decode_close(), ff_amf_encode_close(), ff_bufqueue_add(), ff_bufqueue_discard_all(), ff_cavs_end(), ff_default_get_video_buffer(), ff_ffv1_close(), ff_filter_frame(), ff_filter_frame_framed(), ff_frame_pool_get(), ff_frame_thread_encoder_free(), ff_frame_thread_free(), ff_framequeue_free(), ff_framesync_dualinput_get(), ff_framesync_dualinput_get_writable(), ff_framesync_get_frame(), ff_framesync_uninit(), ff_hwframe_map_create(), ff_hwframe_unmap(), ff_inlink_make_frame_writable(), ff_inlink_set_status(), ff_ivi_decode_close(), ff_load_image(), ff_mjpeg_decode_end(), ff_mpv_common_end(), ff_mpv_encode_end(), ff_nvenc_encode_close(), ff_qsv_decode_close(), ff_qsv_enc_close(), ff_qsvvpp_filter_frame(), ff_snow_common_end(), ff_thread_video_encode_frame(), ff_vc1_decode_end(), ff_vp56_free_context(), ff_vp8_decode_free(), ff_yadif_filter_frame(), ffat_close_encoder(), ffmpeg_cleanup(), fic_decode_close(), fic_decode_frame(), fieldmatch_uninit(), filter_encode_write_frame(), filter_frame(), filter_frame16(), filter_frame8(), fir_frame(), fixstride(), flashsv_decode_end(), flic_decode_end(), flush(), flush_frame(), frame_queue_destory(), framepack_uninit(), framesync_advance(), free_frame(), free_frames(), geq_filter_frame(), get_best_frame(), get_scene_score(), gif_decode_close(), gif_encode_close(), h264_decode_end(), headphone_frame(), hevc_decode_free(), hwaccel_retrieve_data(), hwdownload_filter_frame(), hwframe_pool_prealloc(), hwmap_filter_frame(), hwmap_get_buffer(), hwupload_filter_frame(), if(), ifilter_send_frame(), image_ctx_free(), init(), init_axis_from_file(), init_axis_from_font(), init_frames(), init_output_frame(), inject_frame(), ipvideo_decode_end(), ipvideo_decode_init(), ir2_decode_end(), join_uninit(), kmsgrab_free_frame(), lavfi_read_close(), libopenjpeg_encode_frame(), libwebp_anim_encode_close(), libwebp_anim_encode_frame(), libwebp_encode_close(), libwebp_encode_frame(), LLVMFuzzerTestOneInput(), load_apply_palette(), load_encode_and_write(), magy_encode_frame(), main(), mimic_decode_end(), misc_vaapi_filter_frame(), mm_decode_end(), move_audio(), movie_push_frame(), mp_decode_end(), msrle_decode_end(), mss1_decode_end(), mss1_decode_init(), mss2_decode_end(), mss3_decode_end(), mss3_decode_init(), mss4_decode_end(), msvideo1_decode_end(), mxpeg_decode_end(), neighbor_opencl_filter_frame(), nlmeans_opencl_filter_frame(), nppscale_filter_frame(), nppscale_uninit(), npptranspose_filter_frame(), npptranspose_uninit(), null_filter_frame(), nvenc_alloc_surface(), output_frame(), output_single_frame(), overlay_opencl_blend(), pad_last_frame(), paf_video_close(), pixscope_filter_frame(), plot_freqs(), png_dec_end(), png_dec_init(), png_enc_close(), pp_filter_frame(), procamp_vaapi_filter_frame(), process_frame(), program_opencl_run(), qsv_frame_lock(), qsv_frame_unlock(), qsv_map_from(), qsv_transfer_data_child(), qsvdeint_filter_frame(), qsvdeint_uninit(), qsvscale_filter_frame(), qtrle_decode_end(), qtrle_encode_end(), read_decode_convert_and_store(), read_interval_packets(), read_packet_vs(), receiver_thread(), reget_buffer_internal(), decklink_frame::Release(), request_frame(), return_audio_frame(), return_or_keep_frame(), roq_decode_end(), roq_decode_init(), roq_encode_end(), rpza_decode_end(), rscc_close(), run_test(), scale_vaapi_filter_frame(), screenpresso_close(), seek_test(), sender_thread(), seqvideo_decode_end(), shuffleplanes_filter_frame(), smc_decode_end(), smvjpeg_decode_end(), smvjpeg_decode_init(), spatial_activate(), spawn_empty_frame(), submit_frame(), svq1_decode_end(), svq1_encode_end(), svq3_decode_end(), take_samples(), tdsc_close(), tgv_decode_end(), tonemap_opencl_filter_frame(), transfer_data_alloc(), transpose_opencl_filter_frame(), transpose_vaapi_filter_frame(), truemotion1_decode_end(), truemotion1_decode_init(), try_decode_frame(), try_decode_video_frame(), try_push_frame(), try_push_frames(), tscc2_decode_end(), ulti_decode_end(), uninit(), uninit_segment(), unsharp_opencl_filter_frame(), vaapi_encode_free(), vaapi_encode_issue(), vaapi_encode_wait(), vaapi_transfer_data_from(), vaapi_transfer_data_to(), vc1_decode_init(), video_decode(), video_decode_example(), video_thread(), videotoolbox_uninit(), vmdvideo_decode_end(), vp3_decode_end(), vp8_lossy_decode_alpha(), vp9_decode_free(), vt_transfer_data_from(), vt_transfer_data_to(), worker(), wrapped_avframe_encode(), wrapped_avframe_release_buffer(), write_frame(), write_packet(), xan_decode_end(), xma_decode_end(), xvid_encode_init(), yae_clear(), yop_decode_close(), and zerocodec_decode_close().

◆ av_frame_ref()

int av_frame_ref ( AVFrame dst,
const AVFrame src 
)

Set up a new reference to the data described by the source frame.

Copy frame properties from src to dst and create a new reference for each AVBufferRef from src.

If src is not reference counted, new buffers are allocated and the data is copied.

Warning
: dst MUST have been either unreferenced with av_frame_unref(dst), or newly allocated with av_frame_alloc() before calling this function, or undefined behavior will occur.
Returns
0 on success, a negative AVERROR on error

Definition at line 443 of file frame.c.

Referenced by aasc_decode_frame(), apply_palette(), av_buffersrc_add_frame_flags(), av_buffersrc_add_frame_internal(), av_frame_clone(), av_hwframe_map(), avs_decode_frame(), bethsoftvid_decode_frame(), cavs_decode_frame(), cdg_decode_frame(), cinepak_decode_frame(), cinvideo_decode_frame(), clv_decode_frame(), cmv_decode_frame(), cpia_decode_frame(), decode_frame(), dirac_decode_frame(), do_video_out(), do_vmaf(), encode_apng(), encode_frame(), escape124_decode_frame(), ff_amf_send_frame(), ff_h263_decode_frame(), ff_hevc_output_frame(), ff_hwframe_map_create(), ff_hwframe_map_replace(), ff_mjpeg_decode_frame(), ff_rv34_decode_frame(), ff_thread_ref_frame(), ff_thread_video_encode_frame(), ff_vaapi_encode_send_frame(), ff_vp56_decode_frame(), ff_vp56_decode_mbs(), ffat_encode_callback(), fic_decode_frame(), finish_frame(), flashsv_decode_frame(), flic_decode_frame_15_16BPP(), flic_decode_frame_24BPP(), flic_decode_frame_8BPP(), get_delayed_pic(), gif_decode_frame(), gif_encode_frame(), h261_decode_frame(), ipvideo_decode_frame(), ir2_decode_frame(), load_input_picture(), mimic_decode_frame(), mjpegb_decode_frame(), mm_decode_frame(), mp_decode_frame(), mpeg_decode_frame(), msrle_decode_frame(), mss1_decode_frame(), mss2_decode_frame(), mss3_decode_frame(), mss4_decode_frame(), msvideo1_decode_frame(), mxpeg_decode_frame(), nvenc_upload_frame(), output_frame(), paf_video_decode(), qsv_decode(), qtrle_decode_frame(), qtrle_encode_frame(), return_or_keep_frame(), roq_decode_frame(), rpza_decode_frame(), rscc_decode_frame(), rv10_decode_frame(), screenpresso_decode_frame(), send_frame_to_filters(), seqvideo_decode_frame(), slice_end(), smc_decode_frame(), smvjpeg_decode_frame(), submit_frame(), svq1_decode_frame(), svq3_decode_frame(), tgv_decode_frame(), truemotion1_decode_frame(), tscc2_decode_frame(), ulti_decode_frame(), vc1_decode_frame(), vmdvideo_decode_frame(), vp78_decode_frame(), vp9_decode_frame(), xan_decode_frame(), yop_decode_frame(), and zerocodec_decode_frame().

◆ av_frame_clone()

AVFrame* av_frame_clone ( const AVFrame src)

◆ av_frame_unref()

void av_frame_unref ( AVFrame frame)

Unreference all the buffers referenced by frame and reset the frame fields.

Definition at line 553 of file frame.c.

Referenced by aac_decode_frame_int(), apply_palette(), audio_get_buffer(), av_frame_free(), av_frame_make_writable(), av_frame_ref(), av_hwframe_map(), avcodec_flush_buffers(), avcodec_receive_frame(), cavs_decode_frame(), cdg_decode_frame(), clear_unused_frames(), cmv_decode_frame(), cmv_process_header(), codec_reinit(), decode_audio(), decode_flush(), decode_frame(), decode_packet(), decode_pic(), decode_receive_frame_internal(), decode_simple_internal(), decode_subframe(), decode_video(), dirac_decode_data_unit(), dirac_decode_frame(), do_video_out(), encode_apng(), encode_frame(), escape124_decode_frame(), execute_code(), ff_amf_receive_packet(), ff_hwframe_map_replace(), ff_ivi_decode_frame(), ff_mjpeg_decode_end(), ff_mjpeg_decode_sof(), ff_mpeg_unref_picture(), ff_snow_release_buffer(), ff_thread_flush(), ff_thread_release_buffer(), ff_v4l2_buffer_buf_to_avframe(), ff_vp56_decode_frame(), ff_vp56_decode_mbs(), ffat_encode_callback(), fixstride(), flashsv_decode_frame(), frame_configure_elements(), frame_end(), frame_queue_unref_item(), frame_worker_thread(), free_picture(), free_sequence_buffers(), get_audio_buffer(), get_buffer_internal(), get_video_buffer(), get_video_frame(), gif_decode_frame(), gif_encode_frame(), hevc_frame_start(), hwaccel_retrieve_data(), ifilter_send_frame(), init_frames(), init_stage(), ipvideo_decode_frame(), lavfi_read_packet(), libdav1d_receive_frame(), LLVMFuzzerTestOneInput(), main(), mpeg_decode_frame(), mss2_decode_frame(), mxpeg_decode_frame(), nvenc_upload_frame(), process_output_surface(), qsv_clear_unused_frames(), qsv_transfer_data_to(), qtrle_encode_frame(), reap_filters(), reget_buffer_internal(), release_delayed_buffers(), decklink_output_callback::ScheduledFrameCompleted(), select_input_picture(), smvjpeg_decode_frame(), sub2video_get_blank_frame(), submit_frame(), svq1_decode_frame(), svq1_flush(), svq3_decode_frame(), synth_superframe(), tdsc_decode_jpeg_tile(), tgv_decode_frame(), truemotion1_decode_header(), unrefcount_frame(), video_get_buffer(), video_thread(), videotoolbox_postproc_frame(), videotoolbox_retrieve_data(), vmdvideo_decode_frame(), vorbis_decode_frame(), worker(), wrapped_avframe_decode(), xan_decode_frame(), and zerocodec_decode_frame().

◆ av_frame_move_ref()

void av_frame_move_ref ( AVFrame dst,
AVFrame src 
)

Move everything contained in src to dst and reset src.

Warning
: dst is not unreferenced, but directly overwritten without reading or deallocating its contents. Call av_frame_unref(dst) manually before calling this function to ensure that no memory is leaked.

Definition at line 582 of file frame.c.

Referenced by audio_thread(), av_buffersrc_add_frame_internal(), avcodec_receive_frame(), cavs_decode_frame(), cmv_decode_frame(), cudascale_scale(), decode_frame(), decode_packet(), ff_ivi_decode_frame(), ff_thread_decode_frame(), ff_thread_release_buffer(), fixstride(), hevc_decode_frame(), hwaccel_retrieve_data(), nppscale_scale(), npptranspose_filter(), queue_picture(), reget_buffer_internal(), return_or_keep_frame(), transfer_data_alloc(), unrefcount_frame(), videotoolbox_retrieve_data(), wrapped_avframe_decode(), and wrapped_avframe_encode().

◆ av_frame_get_buffer()

int av_frame_get_buffer ( AVFrame frame,
int  align 
)

Allocate new buffer(s) for audio or video data.

The following fields must be set on frame before calling this function:

  • format (pixel format for video, sample format for audio)
  • width and height for video
  • nb_samples and channel_layout for audio

This function will fill AVFrame.data and AVFrame.buf arrays and, if necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. For planar formats, one buffer will be allocated for each plane.

Warning
: if frame already has been allocated, calling this function will leak memory. In addition, undefined behavior can occur in certain cases.
Parameters
frameframe in which to store the new buffers.
alignRequired buffer size alignment. If equal to 0, alignment will be chosen automatically for the current CPU. It is highly recommended to pass 0 here unless you know what you are doing.
Returns
0 on success, a negative AVERROR on error.

Definition at line 324 of file frame.c.

Referenced by alloc_audio_frame(), alloc_frame(), alloc_frame_empty(), alloc_picture(), apng_encode_frame(), av_frame_make_writable(), av_frame_ref(), avresample_convert_frame(), config_input(), config_output(), decode_entropy_coded_image(), downscale(), encode_apng(), encode_frame(), ff_libwebp_get_frame(), ff_mpv_encode_init(), get_input(), init_output_frame(), main(), pad_last_frame(), qsv_transfer_data_to(), run_test(), sender_thread(), spawn_empty_frame(), sub2video_get_blank_frame(), submit_frame(), swr_convert_frame(), tdsc_parse_tdsf(), transfer_data_alloc(), and videotoolbox_retrieve_data().

◆ av_frame_is_writable()

int av_frame_is_writable ( AVFrame frame)

Check if the frame data is writable.

Returns
A positive value if the frame data is writable (which is true if and only if each of the underlying buffers has only one reference, namely the one stored in this frame). Return 0 otherwise.

If 1 is returned the answer is valid until av_buffer_ref() is called on any of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).

See also
av_frame_make_writable(), av_buffer_is_writable()

Definition at line 594 of file frame.c.

Referenced by apply_lut(), av_frame_make_writable(), compand_nodelay(), ff_inlink_make_frame_writable(), filter_frame(), frame_needs_copy(), and reget_buffer_internal().

◆ av_frame_make_writable()

int av_frame_make_writable ( AVFrame frame)

Ensure that the frame data is writable, avoiding data copy if possible.

Do nothing if the frame is writable, allocate new buffers and copy the data if it is not.

Returns
0 on success, a negative AVERROR on error.
See also
av_frame_is_writable(), av_buffer_is_writable(), av_buffer_make_writable()

Definition at line 611 of file frame.c.

Referenced by activate(), apply_palette(), ff_framesync_get_frame(), ff_h263_decode_frame(), ff_print_debug_info2(), filter_frame(), filter_frame16(), filter_frame8(), get_video_frame(), main(), plot_spectrum_column(), and write_audio_frame().

◆ av_frame_copy()

int av_frame_copy ( AVFrame dst,
const AVFrame src 
)

Copy the frame data from src to dst.

This function does not allocate anything, dst must be already initialized and allocated with the same parameters as src.

This function only copies the frame data (i.e. the contents of the data / extended data arrays), not any other properties.

Returns
>= 0 on success, a negative AVERROR on error.

Definition at line 792 of file frame.c.

Referenced by apng_encode_frame(), av_frame_make_writable(), av_frame_ref(), clv_decode_frame(), decode_frame(), decompress_p(), decompress_p3(), drm_transfer_data_from(), drm_transfer_data_to(), encode_apng(), encode_frame(), ff_libwebp_get_frame(), filter_frame(), interpolate(), pixscope_filter_frame(), qsv_transfer_data_to(), reget_buffer_internal(), roq_decode_frame(), shuffleplanes_filter_frame(), submit_frame(), tdsc_decode_frame(), vaapi_transfer_data_from(), vaapi_transfer_data_to(), vt_transfer_data_from(), and vt_transfer_data_to().

◆ av_frame_copy_props()

int av_frame_copy_props ( AVFrame dst,
const AVFrame src 
)

Copy only "metadata" fields from src to dst.

Metadata for the purpose of this function are those fields that do not affect the data layout in the buffers. E.g. pts, sample rate (for audio) or sample aspect ratio (for video), but not width/height or channel layout. Side data is also copied.

Definition at line 654 of file frame.c.

Referenced by activate(), apply_lut(), apply_palette(), av_frame_make_writable(), avgblur_opencl_filter_frame(), blend_frame(), blend_frames(), compand_delay(), compand_nodelay(), convolution_opencl_filter_frame(), create_weave_frame(), cudascale_scale(), cudaupload_filter_frame(), deint_vaapi_filter_frame(), drm_map_from(), dxva2_map_from(), ff_inlink_make_frame_writable(), ff_yadif_filter_frame(), filter(), filter_frame(), fixstride(), frame_end(), geq_filter_frame(), get_frame(), hwaccel_retrieve_data(), hwdownload_filter_frame(), hwmap_filter_frame(), hwupload_filter_frame(), load_input_picture(), misc_vaapi_filter_frame(), neighbor_opencl_filter_frame(), nlmeans_opencl_filter_frame(), nppscale_scale(), npptranspose_filter(), overlay_opencl_blend(), pad_last_frame(), pixscope_filter_frame(), pp_filter_frame(), procamp_vaapi_filter_frame(), process_frame(), program_opencl_run(), qsvscale_filter_frame(), return_frame(), scale_vaapi_filter_frame(), select_input_picture(), shuffleplanes_filter_frame(), submit_frame(), take_samples(), tonemap_opencl_filter_frame(), transpose_opencl_filter_frame(), transpose_vaapi_filter_frame(), try_push_frame(), unrefcount_frame(), unsharp_opencl_filter_frame(), vaapi_map_to_memory(), and videotoolbox_retrieve_data().

◆ av_frame_get_plane_buffer()

AVBufferRef* av_frame_get_plane_buffer ( AVFrame frame,
int  plane 
)

Get the buffer reference a given data plane is stored in.

Parameters
planeindex of the data plane of interest in frame->extended_data.
Returns
the buffer reference that contains the plane or NULL if the input frame is not valid.

Definition at line 659 of file frame.c.

Referenced by buffer_needs_copy(), and try_push_frame().

◆ av_frame_new_side_data()

AVFrameSideData* av_frame_new_side_data ( AVFrame frame,
enum AVFrameSideDataType  type,
int  size 
)

◆ av_frame_new_side_data_from_buf()

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.

Parameters
framea frame to which the side data should be added
typethe type of the added side data
bufan AVBufferRef to add as side data. The ownership of the reference is transferred to the frame.
Returns
newly added side data on success, NULL on error. On failure the frame is unchanged and the AVBufferRef remains owned by the caller.

Definition at line 690 of file frame.c.

Referenced by av_frame_new_side_data(), av_frame_set_qp_table(), frame_copy_props(), and h264_export_frame_props().

◆ av_frame_get_side_data()

AVFrameSideData* av_frame_get_side_data ( const AVFrame frame,
enum AVFrameSideDataType  type 
)

◆ av_frame_remove_side_data()

void av_frame_remove_side_data ( AVFrame frame,
enum AVFrameSideDataType  type 
)

If side data of the supplied type exists in the frame, free it and remove it from the frame.

Definition at line 805 of file frame.c.

Referenced by av_frame_set_qp_table(), do_video_out(), filter_frame(), and write_frame().

◆ av_frame_apply_cropping()

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.

If cropping is successful, the function will adjust the data pointers and the width/height fields, and set the crop fields to 0.

In all cases, the cropping boundaries will be rounded to the inherent alignment of the pixel format. In some cases, such as for opaque hwaccel formats, the left/top cropping is ignored. The crop fields are set to 0 even if the cropping was rounded or ignored.

Parameters
framethe frame which should be cropped
flagsSome combination of AV_FRAME_CROP_* flags, or 0.
Returns
>= 0 on success, a negative AVERROR on error. If the cropping fields were invalid, AVERROR(ERANGE) is returned, and nothing is changed.

Definition at line 881 of file frame.c.

Referenced by apply_cropping().

◆ av_frame_side_data_name()

const char* av_frame_side_data_name ( enum AVFrameSideDataType  type)
Returns
a string identifying the side data type

Definition at line 819 of file frame.c.

Referenced by show_frame().