112 int read,
size = 0, toc, mode;
121 mode = (toc >> 3) & 0x0F;
124 static const uint8_t packed_size[16] = {
125 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
128 size = packed_size[mode] + 1;
130 static const uint8_t packed_size[16] = {
131 18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1
134 size = packed_size[mode];
151 if (read != size - 1) {
159 #if CONFIG_AMR_DEMUXER
174 .mime_type =
"audio/amr",
178 .write_header = amr_write_header,
179 .write_packet = amr_write_packet,
void av_free_packet(AVPacket *pkt)
Free a packet.
int64_t pos
byte position in stream, -1 if unknown
static int amr_read_header(AVFormatContext *s)
static const char AMR_header[]
static const char AMRWB_header[]
#define MKTAG(a, b, c, d)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
static int amr_probe(AVProbeData *p)
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int bit_rate
the average bitrate
int void avio_flush(AVIOContext *s)
audio channel layout utility functions
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This structure contains the data a format has to probe a file.
static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
#define AVPROBE_SCORE_MAX
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
#define AVFMT_GENERIC_INDEX