124 int read,
size = 0, toc, mode;
134 mode = (toc >> 3) & 0x0F;
138 static const uint8_t packed_size[16] = {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0};
140 size=packed_size[mode]+1;
144 static uint8_t packed_size[16] = {18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1};
146 size=packed_size[mode];
176 #if CONFIG_AMR_DEMUXER
191 .mime_type =
"audio/amr",
195 .write_header = amr_write_header,
196 .write_packet = amr_write_packet,
static int amr_read_header(AVFormatContext *s, AVFormatParameters *ap)
int64_t pos
byte position in stream, -1 if unknown
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static const char AMR_header[]
static const char AMRWB_header[]
void av_free_packet(AVPacket *pkt)
Free a packet.
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.
#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)
int avio_r8(AVIOContext *s)
AVCodecContext * codec
codec context
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)
int frame_size
Samples per packet, initialized when calling 'init'.
enum AVMediaType codec_type
int sample_rate
samples per second
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)
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
#define MKTAG(a, b, c, d)