54 *cont = !!(buf[0] & 0x80);
55 if (!(buf[0] & 0x40)) {
57 *adu_size = buf[0] & ~0xc0;
60 *adu_size =
AV_RB16(buf) & ~0xc000;
80 if (header_size < 0) {
87 if (continuation || adu_size > len) {
99 memcpy(pkt->
data, buf, adu_size);
120 if (!continuation && adu_size <= len) {
129 memcpy(pkt->
data, buf, adu_size);
146 }
else if (!continuation) {
166 "Received packet without a start fragment; dropping.\n");
185 "Error occurred when getting fragment buffer.\n");
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
RTPDynamicProtocolHandler ff_mpeg_audio_robust_dynamic_handler
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
Macro definitions for various function/variable attributes.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int mpa_robust_parse_rtp_header(AVFormatContext *ctx, const uint8_t *buf, int len, unsigned *adu_size, unsigned *cont)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
uint32_t timestamp
current frame timestamp
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static void mpa_robust_close_context(PayloadContext *data)
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
AVIOContext * fragment
buffer for split payloads
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)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * buf
the temporary storage buffer
int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
Close the dynamic buffer and make a packet from it.
This structure stores compressed data.