28 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
31 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, 5, 0, 0, 0, 0, 0
44 if(!data)
return data;
92 for (frames = 1; frames < len && (buf[frames] & 0x80); frames++) ;
94 if (1 + frames >= len) {
100 speech_data = buf + 1 + frames;
110 for (i = 0; i < frames; i++) {
112 int frame_size = frame_sizes[(toc >> 3) & 0x0f];
114 if (speech_data + frame_size > buf + len) {
118 memset(ptr, 0, pkt->
data + pkt->
size - ptr);
127 memcpy(ptr, speech_data, frame_size);
132 if (speech_data < buf + len) {
135 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"))
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int amr_parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, char *attr, char *value)
static int amr_parse_sdp_line(AVFormatContext *s, int st_index, PayloadContext *data, const char *line)
int ff_parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVFormatContext *s, AVStream *stream, PayloadContext *data, char *attr, char *value))
#define AV_LOG_WARNING
Something somehow does not look correct.
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler
static const uint8_t frame_sizes[]
AVStream ** streams
A list of all streams in the file.
static int amr_handle_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
static const uint8_t frame_sizes_nb[16]
static const uint8_t frame_size[4]
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.
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,...)
uint64_t channel_layout
Audio channel layout.
AVCodecContext * codec
Codec context associated with this stream.
audio channel layout utility functions
static const uint8_t frame_sizes_wb[16]
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
#define AV_CH_LAYOUT_MONO
RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler
This structure stores compressed data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...