struct AVPacket

Defined at line 351 of file ../../prebuilt/third_party/ffmpeg/pkg/ffmpeg/include/libavcodec/packet.h

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).

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().

sizeof(AVPacket) being a part of the public ABI is deprecated. once

av_init_packet() is removed, new packets will only be able to be allocated

with av_packet_alloc(), and new fields may be added to the end of the struct

with a minor bump.

Public Members

AVBufferRef * buf
int64_t pts
int64_t dts
uint8_t * data
int size
int stream_index
int flags
AVPacketSideData * side_data
int side_data_elems
int64_t duration
int64_t pos
void * opaque
AVBufferRef * opaque_ref
AVRational time_base