Go to the documentation of this file.
42 13, 14, 16, 18, 20, 21, 27, 32, 6, 1, 1, 1, 1, 1, 1, 1
45 18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 1, 1, 1, 1, 1, 1
135 mode = (toc >> 3) & 0x0F;
158 if (read !=
size - 1) {
168 #if CONFIG_AMR_DEMUXER
180 #if CONFIG_AMRNB_DEMUXER
183 int mode,
i = 0, valid = 0, invalid = 0;
186 while (i < p->buf_size) {
188 if (
mode < 9 && (
b[
i] & 0x4) == 0x4) {
205 if (valid > 100 && valid >> 4 > invalid)
236 #if CONFIG_AMRWB_DEMUXER
239 int mode,
i = 0, valid = 0, invalid = 0;
242 while (i < p->buf_size) {
244 if (
mode < 10 && (
b[
i] & 0x4) == 0x4) {
261 if (valid > 100 && valid >> 4 > invalid)
296 .mime_type =
"audio/amr",
300 .write_header = amr_write_header,
301 .write_packet = amr_write_packet,
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
This struct describes the properties of an encoded stream.
#define AVERROR_EOF
End of file.
#define MKTAG(a, b, c, d)
#define AV_CH_LAYOUT_MONO
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const char AMR_header[]
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
static const uint8_t amrnb_packed_size[16]
This structure contains the data a format has to probe a file.
int sample_rate
Audio only.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const uint8_t header[24]
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int avio_r8(AVIOContext *s)
static const uint8_t amrwb_packed_size[16]
#define i(width, name, range_min, range_max)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int amr_read_header(AVFormatContext *s)
static const char AMRWB_header[]
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
uint64_t channel_layout
Audio only.
static int amr_probe(const AVProbeData *p)
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.