39 bytes = strlen(data_name);
43 fprintf(stderr,
"Error occurred: %s\n",
av_err2str(ret));
47 memcpy(extra_data, data_name, bytes);
54 "Error occurred in av_packet_add_side_data: %s\n",
63 const static uint8_t*
data =
"selftest for av_packet_clone(...)";
73 avpkt->
size = strlen(data);
90 printf(
"failed to initialize variables\n");
106 printf(
"av_grow_packet failed to return error "
107 "when \"grow_by\" parameter is too large.\n" );
112 printf(
"av_new_packet failed to return error "
113 "when \"size\" parameter is too large.\n" );
118 printf(
"av_packet_from_data failed to return error "
119 "when \"size\" parameter is too large.\n" );
ptrdiff_t const GLvoid * data
int64_t pos
byte position in stream, -1 if unknown
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
Initialize a reference-counted packet from av_malloc()ed data.
static int initializations(AVPacket *avpkt)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
int flags
A combination of AV_PKT_FLAG values.
static int setup_side_data_entry(AVPacket *avpkt)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Libavcodec external API header.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
FF_ENABLE_DEPRECATION_WARNINGS 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.
#define AV_PKT_FLAG_DISCARD
Flag is used to discard packets which are required to maintain valid decoder state but are not requir...
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.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
const char * av_packet_side_data_name(enum AVPacketSideDataType type)
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...