53 int rate = 0, channels = 0;
57 len = strlen(mime_type);
58 while (options < mime_type + len) {
59 options = strstr(options,
";");
63 sscanf(options,
" rate=%d", &rate);
65 sscanf(options,
" channels=%d", &channels);
69 "Invalid sample_rate found in mime_type \"%s\"\n",
97 #define PCMDEF(name_, long_name_, ext, codec, ...) \
98 static const AVClass name_ ## _demuxer_class = { \
99 .class_name = #name_ " demuxer", \
100 .item_name = av_default_item_name, \
101 .option = pcm_options, \
102 .version = LIBAVUTIL_VERSION_INT, \
104 AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
106 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
107 .priv_data_size = sizeof(PCMAudioDemuxerContext), \
108 .read_header = pcm_read_header, \
109 .read_packet = ff_pcm_read_packet, \
110 .read_seek = ff_pcm_read_seek, \
111 .flags = AVFMT_GENERIC_INDEX, \
113 .raw_codec_id = codec, \
114 .priv_class = &name_ ## _demuxer_class, \
118 PCMDEF(f64be,
"PCM 64-bit floating-point big-endian",
121 PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
124 PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
127 PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
130 PCMDEF(s32be, "PCM
signed 32-bit big-endian",
133 PCMDEF(s32le, "PCM
signed 32-bit little-endian",
136 PCMDEF(s24be, "PCM
signed 24-bit big-endian",
139 PCMDEF(s24le, "PCM
signed 24-bit little-endian",
142 PCMDEF(s16be, "PCM
signed 16-bit big-endian",
145 PCMDEF(s16le, "PCM
signed 16-bit little-endian",
148 PCMDEF(s8, "PCM
signed 8-bit",
151 PCMDEF(u32be, "PCM
unsigned 32-bit big-endian",
154 PCMDEF(u32le, "PCM
unsigned 32-bit little-endian",
157 PCMDEF(u24be, "PCM
unsigned 24-bit big-endian",
160 PCMDEF(u24le, "PCM
unsigned 24-bit little-endian",
163 PCMDEF(u16be, "PCM
unsigned 16-bit big-endian",
166 PCMDEF(u16le, "PCM
unsigned 16-bit little-endian",
169 PCMDEF(u8, "PCM
unsigned 8-bit",
175 PCMDEF(mulaw, "PCM mu-law",
178 static const
AVOption sln_options[] = {
187 .option = sln_options,
201 .priv_class = &sln_demuxer_class,
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define LIBAVUTIL_VERSION_INT
static int pcm_read_header(AVFormatContext *s)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
const OptionDef options[]
static const AVClass sln_demuxer_class
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
#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.
simple assert() macros that are a bit more flexible than ISO C assert().
static const AVOption pcm_options[]
int block_align
Audio only.
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
AVIOContext * pb
I/O context.
Describe the class of an AVClass context structure.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
#define PCMDEF(name_, long_name_, ext, codec,...)
int sample_rate
Audio only.
struct AVInputFormat * iformat
The input container format.
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
void * priv_data
Format private data.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVInputFormat ff_sln_demuxer
AVCodecParameters * codecpar