![]() |
Miam-Player
0.8.0
A nice music player
|
Modules | |
AV_FRAME_FLAGS | |
Files | |
file | frame.h |
Classes | |
struct | AVFrameSideData |
struct | AVFrame |
Typedefs | |
typedef struct AVFrameSideData | AVFrameSideData |
typedef struct AVFrame | AVFrame |
AVFrame is an abstraction for reference-counted raw multimedia data.
This structure describes decoded (raw) audio or video data.
AVFrame must be allocated using av_frame_alloc(). Note that this only allocates the AVFrame itself, the buffers for the data must be managed through other means (see below). AVFrame must be freed with av_frame_free().
AVFrame is typically allocated once and then reused multiple times to hold different data (e.g. a single AVFrame to hold frames received from a decoder). In such a case, av_frame_unref() will free any references held by the frame and reset it to its original clean state before it is reused again.
The data described by an AVFrame is usually reference counted through the AVBuffer API. The underlying buffer references are stored in AVFrame.buf / AVFrame.extended_buf. An AVFrame is considered to be reference counted if at least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, every single data plane must be contained in one of the buffers in AVFrame.buf or AVFrame.extended_buf. There may be a single buffer for all the data, or one separate buffer for each plane, or anything in between.
sizeof(AVFrame) is not a part of the public ABI, so new fields may be added to the end with a minor bump. Similarly fields that are marked as to be only accessed by av_opt_ptr() can be reordered. This allows 2 forks to add fields without breaking compatibility with each other.
Fields can be accessed through AVOptions, the name string used, matches the C structure field name for fields accessible through AVOptions. The AVClass for AVFrame can be obtained from avcodec_get_frame_class()
typedef struct AVFrameSideData AVFrameSideData |
Structure to hold side data for an AVFrame.
sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added to the end with a minor bump.
enum 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. |
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. |
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().
Create a new frame that references the same data as src.
This is a shortcut for av_frame_alloc()+av_frame_ref().
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.
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.
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.
frame | frame to be freed. The pointer will be set to NULL. |
int64_t av_frame_get_best_effort_timestamp | ( | const AVFrame * | frame | ) |
Accessors for some AVFrame fields. The position of these field in the structure is not part of the ABI, they should not be accessed directly outside libavutil.
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:
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.
frame | frame in which to store the new buffers. |
align | required buffer size alignment |
int64_t av_frame_get_channel_layout | ( | const AVFrame * | frame | ) |
int av_frame_get_channels | ( | const AVFrame * | frame | ) |
enum AVColorRange av_frame_get_color_range | ( | const AVFrame * | frame | ) |
enum AVColorSpace av_frame_get_colorspace | ( | const AVFrame * | frame | ) |
int av_frame_get_decode_error_flags | ( | const AVFrame * | frame | ) |
AVDictionary* av_frame_get_metadata | ( | const AVFrame * | frame | ) |
int64_t av_frame_get_pkt_duration | ( | const AVFrame * | frame | ) |
int64_t av_frame_get_pkt_pos | ( | const AVFrame * | frame | ) |
int av_frame_get_pkt_size | ( | const AVFrame * | frame | ) |
AVBufferRef* av_frame_get_plane_buffer | ( | AVFrame * | frame, |
int | plane | ||
) |
Get the buffer reference a given data plane is stored in.
plane | index of the data plane of interest in frame->extended_data. |
int8_t* av_frame_get_qp_table | ( | AVFrame * | f, |
int * | stride, | ||
int * | type | ||
) |
int av_frame_get_sample_rate | ( | const AVFrame * | frame | ) |
AVFrameSideData* av_frame_get_side_data | ( | const AVFrame * | frame, |
enum AVFrameSideDataType | type | ||
) |
int av_frame_is_writable | ( | AVFrame * | frame | ) |
Check if the frame data is writable.
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).
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.
Move everything contained in src to dst and reset src.
AVFrameSideData* av_frame_new_side_data | ( | AVFrame * | frame, |
enum AVFrameSideDataType | type, | ||
int | size | ||
) |
Add a new side data to a frame.
frame | a frame to which the side data should be added |
type | type of the added side data |
size | size of the side data |
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.
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.
void av_frame_set_best_effort_timestamp | ( | AVFrame * | frame, |
int64_t | val | ||
) |
void av_frame_set_channel_layout | ( | AVFrame * | frame, |
int64_t | val | ||
) |
void av_frame_set_channels | ( | AVFrame * | frame, |
int | val | ||
) |
void av_frame_set_color_range | ( | AVFrame * | frame, |
enum AVColorRange | val | ||
) |
void av_frame_set_colorspace | ( | AVFrame * | frame, |
enum AVColorSpace | val | ||
) |
void av_frame_set_decode_error_flags | ( | AVFrame * | frame, |
int | val | ||
) |
void av_frame_set_metadata | ( | AVFrame * | frame, |
AVDictionary * | val | ||
) |
void av_frame_set_pkt_duration | ( | AVFrame * | frame, |
int64_t | val | ||
) |
void av_frame_set_pkt_pos | ( | AVFrame * | frame, |
int64_t | val | ||
) |
void av_frame_set_pkt_size | ( | AVFrame * | frame, |
int | val | ||
) |
int av_frame_set_qp_table | ( | AVFrame * | f, |
AVBufferRef * | buf, | ||
int | stride, | ||
int | type | ||
) |
void av_frame_set_sample_rate | ( | AVFrame * | frame, |
int | val | ||
) |
const char* av_frame_side_data_name | ( | enum AVFrameSideDataType | type | ) |
void av_frame_unref | ( | AVFrame * | frame | ) |
Unreference all the buffers referenced by frame and reset the frame fields.
const char* av_get_colorspace_name | ( | enum AVColorSpace | val | ) |
Get the name of a colorspace.
AVDictionary** avpriv_frame_get_metadatap | ( | AVFrame * | frame | ) |