Go to the documentation of this file.
44 const uint8_t *buf,
int len,
45 unsigned *adu_size,
unsigned *cont)
54 *cont = !!(buf[0] & 0x80);
55 if (!(buf[0] & 0x40)) {
57 *adu_size = buf[0] & ~0xc0;
60 *adu_size =
AV_RB16(buf) & ~0xc000;
68 uint32_t *timestamp,
const uint8_t *buf,
71 unsigned adu_size, continuation;
75 buf = &
data->split_buf[
data->split_pos];
80 if (header_size < 0) {
87 if (continuation || adu_size >
len) {
99 memcpy(
pkt->
data, buf, adu_size);
101 data->split_pos += header_size + adu_size;
103 if (
data->split_pos ==
data->split_buf_size) {
120 if (!continuation && adu_size <=
len) {
129 memcpy(
pkt->
data, buf, adu_size);
137 if (!
data->split_buf) {
142 memcpy(
data->split_buf, buf,
data->split_buf_size);
146 }
else if (!continuation) {
150 data->adu_size = adu_size;
152 data->timestamp = *timestamp;
164 if (!
data->fragment) {
166 "Received packet without a start fragment; dropping.\n");
169 if (adu_size !=
data->adu_size ||
170 data->timestamp != *timestamp) {
179 if (
data->cur_size <
data->adu_size)
185 "Error occurred when getting fragment buffer.\n");
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
const RTPDynamicProtocolHandler ff_mpeg_audio_robust_dynamic_handler
static int mpa_robust_parse_rtp_header(AVFormatContext *ctx, const uint8_t *buf, int len, unsigned *adu_size, unsigned *cont)
int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
Close the dynamic buffer and make a packet from it.
uint32_t timestamp
current frame timestamp
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
AVIOContext * fragment
buffer for split payloads
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static int mpa_robust_parse_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
static void mpa_robust_close_context(PayloadContext *data)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
int index
stream index in AVFormatContext
static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index, int flush)
Parse a packet, add all split parts to parse_queue.
This structure stores compressed data.
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
RTP/JPEG specific private data.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16