![]() |
Miam-Player
0.8.0
A nice music player
|
Classes | |
struct | AVPacketSideData |
struct | AVPacket |
Macros | |
#define | AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS |
#define | AV_PKT_FLAG_KEY 0x0001 |
The packet contains a keyframe. More... | |
#define | AV_PKT_FLAG_CORRUPT 0x0002 |
The packet content is corrupted. More... | |
#define | AV_PKT_FLAG_DISCARD 0x0004 |
Typedefs | |
typedef struct AVPacketSideData | AVPacketSideData |
typedef struct AVPacket | AVPacket |
Types and functions for working with AVPacket.
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS |
#define AV_PKT_FLAG_CORRUPT 0x0002 |
The packet content is corrupted.
#define AV_PKT_FLAG_DISCARD 0x0004 |
Flag is used to discard packets which are required to maintain valid decoder state but are not required for output and should be dropped after decoding.
#define AV_PKT_FLAG_KEY 0x0001 |
The packet contains a keyframe.
This structure stores compressed data. It is typically exported by demuxers and then passed as input to decoders, or received as output from encoders and then passed to muxers.
For video, it should typically contain one compressed frame. For audio it may contain several compressed frames. Encoders are allowed to output empty packets, with no compressed data, containing only side data (e.g. to update some stream parameters at the end of encoding).
AVPacket is one of the few structs in FFmpeg, whose size is a part of public ABI. Thus it may be allocated on stack and no new fields can be added to it without libavcodec and libavformat major bump.
The semantics of data ownership depends on the buf field. If it is set, the packet data is dynamically allocated and is valid indefinitely until a call to av_packet_unref() reduces the reference count to 0.
If the buf field is not set av_packet_ref() would make a copy instead of increasing the reference count.
The side data is always allocated with av_malloc(), copied by av_packet_ref() and freed by av_packet_unref().
typedef struct AVPacketSideData AVPacketSideData |
enum AVPacketSideDataType |
Enumerator | |
---|---|
AV_PKT_DATA_PALETTE | |
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 changed and the receiving side should act upon it appropriately. The new extradata is embedded in the side data buffer and should be immediately used for processing the current frame or packet. |
AV_PKT_DATA_PARAM_CHANGE |
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: |
AV_PKT_DATA_H263_MB_INFO |
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g. as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows: |
AV_PKT_DATA_REPLAYGAIN |
This side data should be associated with an audio stream and contains ReplayGain information in form of the AVReplayGain struct. |
AV_PKT_DATA_DISPLAYMATRIX |
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to be applied to the decoded video frames for correct presentation. See libavutil/display.h for a detailed description of the data. |
AV_PKT_DATA_STEREO3D |
This side data should be associated with a video stream and contains Stereoscopic 3D information in form of the AVStereo3D struct. |
AV_PKT_DATA_AUDIO_SERVICE_TYPE |
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType. |
AV_PKT_DATA_QUALITY_STATS |
This side data contains quality related information from the encoder. |
AV_PKT_DATA_FALLBACK_TRACK |
This side data contains an integer value representing the stream index of a "fallback" track. A fallback track indicates an alternate track to use when the current track can not be decoded for some reason. e.g. no decoder available for codec. |
AV_PKT_DATA_CPB_PROPERTIES |
This side data corresponds to the AVCPBProperties struct. |
AV_PKT_DATA_SKIP_SAMPLES |
Recommmends skipping the specified number of samples |
AV_PKT_DATA_JP_DUALMONO |
An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used. |
AV_PKT_DATA_STRINGS_METADATA |
A list of zero terminated key/value strings. There is no end marker for the list, so it is required to rely on the side data size to stop. |
AV_PKT_DATA_SUBTITLE_POSITION |
Subtitle event position |
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL |
Data found in BlockAdditional element of matroska container. There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data. |
AV_PKT_DATA_WEBVTT_IDENTIFIER |
The optional first identifier line of a WebVTT cue. |
AV_PKT_DATA_WEBVTT_SETTINGS |
The optional settings (rendering instructions) that immediately follow the timestamp specifier of a WebVTT cue. |
AV_PKT_DATA_METADATA_UPDATE |
A list of zero terminated key/value strings. There is no end marker for the list, so it is required to rely on the side data size to stop. This side data includes updated metadata which appeared in the stream. |
AV_PKT_DATA_MPEGTS_STREAM_ID |
MPEGTS stream ID, this is required to pass the stream ID information from the demuxer to the corresponding muxer. |
AV_PKT_DATA_MASTERING_DISPLAY_METADATA |
Mastering display metadata (based on SMPTE-2086:2014). This metadata should be associated with a video stream and containts data in the form of the AVMasteringDisplayMetadata struct. |
Copy packet, including contents
Copy packet side data
attribute_deprecated int av_dup_packet | ( | AVPacket * | pkt | ) |
attribute_deprecated void av_free_packet | ( | AVPacket * | pkt | ) |
int av_grow_packet | ( | AVPacket * | pkt, |
int | grow_by | ||
) |
Increase packet size, correctly zeroing padding
pkt | packet |
grow_by | number of bytes by which to increase the size of the packet |
void av_init_packet | ( | AVPacket * | pkt | ) |
Initialize optional fields of a packet with default values.
Note, this does not touch the data and size members, which have to be initialized separately.
pkt | packet |
int av_new_packet | ( | AVPacket * | pkt, |
int | size | ||
) |
Allocate the payload of a packet and initialize its fields with default values.
pkt | packet |
size | wanted payload size |
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.
pkt | packet |
type | side information type |
data | the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to pkt. |
size | side information size |
AVPacket* av_packet_alloc | ( | void | ) |
Allocate an AVPacket and set its fields to default values. The resulting struct must be freed using av_packet_free().
Create a new packet that references the same data as src.
This is a shortcut for av_packet_alloc()+av_packet_ref().
Copy only "properties" fields from src to dst.
Properties for the purpose of this function are all the fields beside those related to the packet data (buf, data, size)
dst | Destination packet |
src | Source packet |
void av_packet_free | ( | AVPacket ** | pkt | ) |
Free the packet, if the packet is reference counted, it will be unreferenced first.
packet | packet to be freed. The pointer will be set to NULL. |
void av_packet_free_side_data | ( | AVPacket * | pkt | ) |
Convenience function to free all the side data stored. All the other fields stay untouched.
pkt | packet |
int av_packet_from_data | ( | AVPacket * | pkt, |
uint8_t * | data, | ||
int | size | ||
) |
Initialize a reference-counted packet from av_malloc()ed data.
pkt | packet to be initialized. This function will set the data, size, buf and destruct fields, all others are left untouched. |
data | Data allocated by av_malloc() to be used as packet data. If this function returns successfully, the data is owned by the underlying AVBuffer. The caller may not access the data through other means. |
size | size of data in bytes, without the padding. I.e. the full buffer size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. |
uint8_t* av_packet_get_side_data | ( | AVPacket * | pkt, |
enum AVPacketSideDataType | type, | ||
int * | size | ||
) |
Get side information from packet.
pkt | packet |
type | desired side information type |
size | pointer for side information size to store (optional) |
int av_packet_merge_side_data | ( | AVPacket * | pkt | ) |
Move every field in src to dst and reset src.
src | Source packet, will be reset |
dst | Destination packet |
uint8_t* av_packet_new_side_data | ( | AVPacket * | pkt, |
enum AVPacketSideDataType | type, | ||
int | size | ||
) |
Allocate new information of a packet.
pkt | packet |
type | side information type |
size | side information size |
uint8_t* av_packet_pack_dictionary | ( | AVDictionary * | dict, |
int * | size | ||
) |
Pack a dictionary for use in side_data.
dict | The dictionary to pack. |
size | pointer to store the size of the returned data |
Setup a new reference to the data described by a given packet
If src is reference-counted, setup dst as a new reference to the buffer in src. Otherwise allocate a new buffer in dst and copy the data from src into it.
All the other fields are copied from src.
dst | Destination packet |
src | Source packet |
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. Timestamps with unknown values (AV_NOPTS_VALUE) will be ignored.
pkt | packet on which the conversion will be performed |
tb_src | source timebase, in which the timing fields in pkt are expressed |
tb_dst | destination timebase, to which the timing fields will be converted |
int av_packet_shrink_side_data | ( | AVPacket * | pkt, |
enum AVPacketSideDataType | type, | ||
int | size | ||
) |
Shrink the already allocated side data buffer
pkt | packet |
type | side information type |
size | new side information size |
const char* av_packet_side_data_name | ( | enum AVPacketSideDataType | type | ) |
int av_packet_split_side_data | ( | AVPacket * | pkt | ) |
int av_packet_unpack_dictionary | ( | const uint8_t * | data, |
int | size, | ||
AVDictionary ** | dict | ||
) |
Unpack a dictionary from side_data.
data | data from side_data |
size | size of the data |
dict | the metadata storage dictionary |
void av_packet_unref | ( | AVPacket * | pkt | ) |
Wipe the packet.
Unreference the buffer referenced by the packet and reset the remaining packet fields to their default values.
pkt | The packet to be unreferenced. |
void av_shrink_packet | ( | AVPacket * | pkt, |
int | size | ||
) |
Reduce packet size, correctly zeroing padding
pkt | packet |
size | new size |