29#define GSM_BLOCK_SIZE 33
30#define GSM_BLOCK_SAMPLES 160
31#define GSM_SAMPLE_RATE 8000
40 int valid = 0, invalid = 0;
42 while (
b < p->buf + p->buf_size - 32) {
43 if ((*
b & 0xf0) == 0xd0) {
50 if (valid >> 5 > invalid)
62 pkt->stream_index = 0;
100 .class_name =
"gsm demuxer",
110 .p.extensions =
"gsm",
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_CODEC_ID_GSM
as in Berlin toast format
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AV_CHANNEL_LAYOUT_MONO
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.