81 if (pkt->
size <= size)
return;
103 #define DUP_DATA(dst, src, size, padding) \
107 if ((unsigned)(size) > (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, FF_INPUT_BUFFER_PADDING_SIZE); \
166 if ((
unsigned)elems + 1 > INT_MAX /
sizeof(*pkt->
side_data))
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
void av_destruct_packet(AVPacket *pkt)
Default packet destructor.
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
int64_t pos
byte position in stream, -1 if unknown
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
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 *)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
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 flags
A combination of AV_PKT_FLAG values.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
void av_free_packet(AVPacket *pkt)
Free a packet.
#define DUP_DATA(dst, src, size, padding)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
struct AVPacket::@10 * side_data
Additional packet data that can be provided by the container.
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
void av_destruct_packet_nofree(AVPacket *pkt)
int av_dup_packet(AVPacket *pkt)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
enum AVPacketSideDataType type
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.