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",
99 #define PCMDEF(name_, long_name_, ext, codec, ...) \
100 static const AVClass name_ ## _demuxer_class = { \
101 .class_name = #name_ " demuxer", \
102 .item_name = av_default_item_name, \
103 .option = pcm_options, \
104 .version = LIBAVUTIL_VERSION_INT, \
106 AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
108 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
109 .priv_data_size = sizeof(PCMAudioDemuxerContext), \
110 .read_header = pcm_read_header, \
111 .read_packet = ff_pcm_read_packet, \
112 .read_seek = ff_pcm_read_seek, \
113 .flags = AVFMT_GENERIC_INDEX, \
115 .raw_codec_id = codec, \
116 .priv_class = &name_ ## _demuxer_class, \
120 PCMDEF(f64be,
"PCM 64-bit floating-point big-endian",
123 PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
126 PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
129 PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
132 PCMDEF(s32be, "PCM
signed 32-bit big-endian",
135 PCMDEF(s32le, "PCM
signed 32-bit little-endian",
138 PCMDEF(s24be, "PCM
signed 24-bit big-endian",
141 PCMDEF(s24le, "PCM
signed 24-bit little-endian",
144 PCMDEF(s16be, "PCM
signed 16-bit big-endian",
147 PCMDEF(s16le, "PCM
signed 16-bit little-endian",
150 PCMDEF(s8, "PCM
signed 8-bit",
153 PCMDEF(u32be, "PCM
unsigned 32-bit big-endian",
156 PCMDEF(u32le, "PCM
unsigned 32-bit little-endian",
159 PCMDEF(u24be, "PCM
unsigned 24-bit big-endian",
162 PCMDEF(u24le, "PCM
unsigned 24-bit little-endian",
165 PCMDEF(u16be, "PCM
unsigned 16-bit big-endian",
168 PCMDEF(u16le, "PCM
unsigned 16-bit little-endian",
171 PCMDEF(u8, "PCM
unsigned 8-bit",
177 PCMDEF(mulaw, "PCM mu-law",
180 static const
AVOption sln_options[] = {
189 .option = sln_options,
203 .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