77 if (pkt->
size <= size)
89 if ((
unsigned)grow_by >
102 #define DUP_DATA(dst, src, size, padding) \
106 if ((unsigned)(size) > \
107 (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE) \
109 data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); \
111 data = av_malloc(size); \
115 memcpy(data, src, size); \
117 memset((uint8_t *)data + size, 0, \
118 FF_INPUT_BUFFER_PADDING_SIZE); \
170 if ((
unsigned)elems + 1 > INT_MAX /
sizeof(*pkt->
side_data))
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void av_free_packet(AVPacket *pkt)
Free a packet.
memory handling functions
int64_t pos
byte position in stream, -1 if unknown
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
int av_dup_packet(AVPacket *pkt)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
void(* destruct)(struct AVPacket *)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int64_t convergence_duration
Time difference in AVStream->time_base units from the pts of this packet to the point at which the ou...
simple assert() macros that are a bit more flexible than ISO C assert().
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Shrink the already allocated side data buffer.
int flags
A combination of AV_PKT_FLAG values.
void av_destruct_packet(AVPacket *pkt)
Default packet destructor.
#define DUP_DATA(dst, src, size, padding)
#define FF_INPUT_BUFFER_PADDING_SIZE
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
struct AVPacket::@11 * side_data
Additional packet data that can be provided by the container.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
enum AVPacketSideDataType type
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...