21#ifndef AVCODEC_PACKET_H
22#define AVCODEC_PACKET_H
431 size_t size,
int flags);
454 void *data,
size_t size,
int flags);
635#if FF_API_INIT_PACKET
637typedef struct AVPacketList {
639 struct AVPacketList *next;
643#define AV_PKT_FLAG_KEY 0x0001
644#define AV_PKT_FLAG_CORRUPT 0x0002
650#define AV_PKT_FLAG_DISCARD 0x0004
657#define AV_PKT_FLAG_TRUSTED 0x0008
662#define AV_PKT_FLAG_DISPOSABLE 0x0010
703#if FF_API_INIT_PACKET
788 uint8_t *data,
size_t size);
Macro definitions for various function/variable attributes.
#define attribute_deprecated
refcounted data buffer API
struct AVContainerFifo AVContainerFifo
AVContainerFifo is a FIFO for "containers" - dynamically allocated reusable structs (e....
void av_packet_side_data_free(AVPacketSideData **sd, int *nb_sd)
Convenience function to free all the side data stored in an array, and the array itself.
AVPacketSideData * av_packet_side_data_new(AVPacketSideData **psd, int *pnb_sd, enum AVPacketSideDataType type, size_t size, int flags)
Allocate a new packet side data.
const char * av_packet_side_data_name(enum AVPacketSideDataType type)
void av_packet_side_data_remove(AVPacketSideData *sd, int *nb_sd, enum AVPacketSideDataType type)
Remove side data of the given type from a side data array.
int av_packet_side_data_to_frame(struct AVFrameSideData ***sd, int *nb_sd, const AVPacketSideData *src, unsigned int flags)
Add a new frame side data entry to an array based on existing packet side data, if a matching type ex...
AVPacketSideData * av_packet_side_data_add(AVPacketSideData **sd, int *nb_sd, enum AVPacketSideDataType type, void *data, size_t size, int flags)
Wrap existing data as packet side data.
int av_packet_side_data_from_frame(AVPacketSideData **sd, int *nb_sd, const struct AVFrameSideData *src, unsigned int flags)
Add a new packet side data entry to an array based on existing frame side data, if a matching type ex...
const AVPacketSideData * av_packet_side_data_get(const AVPacketSideData *sd, int nb_sd, enum AVPacketSideDataType type)
Get side information from a side data array.
@ AV_PKT_DATA_JP_DUALMONO
An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio s...
@ AV_PKT_DATA_STRINGS_METADATA
A list of zero terminated key/value strings.
@ AV_PKT_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1:2014.
@ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
@ AV_PKT_DATA_SKIP_SAMPLES
Recommends skipping the specified number of samples.
@ AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM
IAMF Recon Gain Info Parameter Data associated with the audio frame.
@ AV_PKT_DATA_MPEGTS_STREAM_ID
MPEGTS stream ID as uint8_t, this is required to pass the stream ID information from the demuxer to t...
@ AV_PKT_DATA_DYNAMIC_HDR10_PLUS
HDR10+ dynamic metadata associated with a video frame.
@ AV_PKT_DATA_PRFT
Producer Reference Time data corresponding to the AVProducerReferenceTime struct, usually exported by...
@ AV_PKT_DATA_H263_MB_INFO
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
@ AV_PKT_DATA_3D_REFERENCE_DISPLAYS
This side data contains information about the reference display width(s) and reference viewing distan...
@ AV_PKT_DATA_ICC_PROFILE
ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1.
@ AV_PKT_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata (based on SMPTE-2086:2014).
@ AV_PKT_DATA_RTCP_SR
Contains the last received RTCP SR (Sender Report) information in the form of the AVRTCPSenderReport ...
@ AV_PKT_DATA_AUDIO_SERVICE_TYPE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
@ AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM
IAMF Demixing Info Parameter Data associated with the audio frame.
@ AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
Data found in BlockAdditional element of matroska container.
@ AV_PKT_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
@ AV_PKT_DATA_SPHERICAL
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
@ AV_PKT_DATA_QUALITY_STATS
This side data contains quality related information from the encoder.
@ AV_PKT_DATA_WEBVTT_SETTINGS
The optional settings (rendering instructions) that immediately follow the timestamp specifier of a W...
@ AV_PKT_DATA_METADATA_UPDATE
A list of zero terminated key/value strings.
@ AV_PKT_DATA_SUBTITLE_POSITION
Subtitle event position.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
@ AV_PKT_DATA_ENCRYPTION_INFO
This side data contains encryption info for how to decrypt the packet.
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
@ AV_PKT_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
@ AV_PKT_DATA_EXIF
Extensible image file format metadata.
@ AV_PKT_DATA_ENCRYPTION_INIT_INFO
This side data is encryption initialization data.
@ AV_PKT_DATA_CPB_PROPERTIES
This side data corresponds to the AVCPBProperties struct.
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
@ AV_PKT_DATA_NB
The number of side data types.
@ AV_PKT_DATA_PARAM_CHANGE
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
@ AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
@ AV_PKT_DATA_WEBVTT_IDENTIFIER
The optional first identifier line of a WebVTT cue.
@ AV_PKT_DATA_FRAME_CROPPING
The number of pixels to discard from the top/bottom/left/right border of the decoded frame to obtain ...
@ AV_PKT_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
@ AV_PKT_DATA_FALLBACK_TRACK
This side data contains an integer value representing the stream index of a "fallback" track.
@ AV_PKT_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
@ AV_PKT_DATA_IAMF_MIX_GAIN_PARAM
IAMF Mix Gain Parameter Data associated with the audio frame.
@ AV_PKT_DATA_REPLAYGAIN
This side data should be associated with an audio stream and contains ReplayGain information in form ...
@ AV_PKT_DATA_DOVI_CONF
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2....
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Shrink the already allocated side data buffer.
AVSideDataParamChangeFlags
void av_packet_free_side_data(AVPacket *pkt)
Convenience function to free all the side data stored.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
Initialize a reference-counted packet from av_malloc()ed data.
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
int av_packet_make_refcounted(AVPacket *pkt)
Ensure the data described by a given packet is reference counted.
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as a packet side data.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
struct AVContainerFifo * av_container_fifo_alloc_avpacket(unsigned flags)
Allocate an AVContainerFifo instance for AVPacket.
int av_packet_make_writable(AVPacket *pkt)
Create a writable reference for the data described by a given packet, avoiding data copy if possible.
int av_packet_unpack_dictionary(const uint8_t *data, size_t size, AVDictionary **dict)
Unpack a dictionary from side_data.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
uint8_t * av_packet_pack_dictionary(AVDictionary *dict, size_t *size)
Pack a dictionary for use in side_data.
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst)
Convert valid timing fields (timestamps / durations) in a packet from one timebase to another.
@ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE
@ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS
struct AVDictionary AVDictionary
Libavcodec version macros.
Libavutil version macros.
Utilities for rational number calculation.
A reference to a data buffer.
Structure to hold side data for an AVFrame.
enum AVFrameSideDataType type
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
enum AVPacketSideDataType type
This structure stores compressed data.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
void * opaque
for some private data of the user
AVBufferRef * opaque_ref
AVBufferRef for free use by the API user.
int64_t pos
byte position in stream, -1 if unknown
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
AVRational time_base
Time base of the packet's timestamps.
Rational number (pair of numerator and denominator).