27 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
30 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, 5, 0, 0, 0, 0, 0
43 if(!data)
return data;
64 const uint8_t *speech_data;
93 for (frames = 1; frames < len && (buf[frames] & 0x80); frames++) ;
95 if (1 + frames >= len) {
101 speech_data = buf + 1 + frames;
111 for (i = 0; i < frames; i++) {
112 uint8_t toc = buf[1 + i];
113 int frame_size = frame_sizes[(toc >> 3) & 0x0f];
115 if (speech_data + frame_size > buf + len) {
119 memset(ptr, 0, pkt->
data + pkt->
size - ptr);
128 memcpy(ptr, speech_data, frame_size);
129 speech_data += frame_size;
133 if (speech_data < buf + len) {
136 memset(ptr, 0, pkt->
data + pkt->
size - ptr);
144 char *attr,
char *value)
150 if (!strcmp(value,
"")) {
152 "nonstandard empty value\n", attr);
155 if (!strcmp(attr,
"octet-align"))
157 else if (!strcmp(attr,
"crc"))
158 data->
crc = atoi(value);
159 else if (!strcmp(attr,
"interleaving"))
161 else if (!strcmp(attr,
"channels"))
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int amr_parse_sdp_line(AVFormatContext *s, int st_index, PayloadContext *data, const char *line)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_WARNING
Something somehow does not look correct.
RTP/H264 specific private data.
int index
stream index in AVFormatContext
RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler
static const uint8_t frame_sizes[]
RTP Depacketization of QCELP/PureVoice, RFC 2658 Copyright (c) 2010 Martin Storsjo.
static int amr_parse_fmtp(AVStream *stream, PayloadContext *data, char *attr, char *value)
static const uint8_t frame_sizes_nb[16]
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void av_log(void *avcl, int level, const char *fmt,...)
AVCodecContext * codec
codec context
static int amr_handle_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, int flags)
static const uint8_t frame_sizes_wb[16]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void amr_free_context(PayloadContext *data)
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
static PayloadContext * amr_new_context(void)
int channels
number of audio channels
int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVStream *stream, PayloadContext *data, char *attr, char *value))
RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler