126 mode = (toc >> 3) & 0x0F;
129 static const uint8_t packed_size[16] = {
130 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
133 size = packed_size[
mode] + 1;
135 static const uint8_t packed_size[16] = {
136 18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1
139 size = packed_size[
mode];
157 if (read != size - 1) {
165 #if CONFIG_AMR_DEMUXER
181 .mime_type =
"audio/amr",
185 .write_header = amr_write_header,
186 .write_packet = amr_write_packet,
int64_t pos
byte position in stream, -1 if unknown
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
static int amr_read_header(AVFormatContext *s)
static const char AMR_header[]
This struct describes the properties of an encoded stream.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
static const char AMRWB_header[]
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const uint8_t header[24]
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
uint64_t channel_layout
Audio only.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
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. ...
enum AVMediaType codec_type
General type of the encoded data.
static int amr_probe(AVProbeData *p)
int avio_r8(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
audio channel layout utility functions
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
This structure contains the data a format has to probe a file.
static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
int sample_rate
Audio only.
void * priv_data
Format private data.
AVCodecParameters * codecpar
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
This structure stores compressed data.