68 #define PCMDEF(name_, long_name_, ext, codec) \
69 static const AVClass name_ ## _demuxer_class = { \
70 .class_name = #name_ " demuxer", \
71 .item_name = av_default_item_name, \
72 .option = pcm_options, \
73 .version = LIBAVUTIL_VERSION_INT, \
75 AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
77 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
78 .priv_data_size = sizeof(PCMAudioDemuxerContext), \
79 .read_header = pcm_read_header, \
80 .read_packet = ff_pcm_read_packet, \
81 .read_seek = ff_pcm_read_seek, \
82 .flags = AVFMT_GENERIC_INDEX, \
84 .raw_codec_id = codec, \
85 .priv_class = &name_ ## _demuxer_class, \
88 PCMDEF(f64be,
"PCM 64-bit floating-point big-endian",
91 PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
94 PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
97 PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
100 PCMDEF(s32be, "PCM
signed 32-bit big-endian",
103 PCMDEF(s32le, "PCM
signed 32-bit little-endian",
106 PCMDEF(s24be, "PCM
signed 24-bit big-endian",
109 PCMDEF(s24le, "PCM
signed 24-bit little-endian",
112 PCMDEF(s16be, "PCM
signed 16-bit big-endian",
115 PCMDEF(s16le, "PCM
signed 16-bit little-endian",
118 PCMDEF(s8, "PCM
signed 8-bit",
121 PCMDEF(u32be, "PCM
unsigned 32-bit big-endian",
124 PCMDEF(u32le, "PCM
unsigned 32-bit little-endian",
127 PCMDEF(u24be, "PCM
unsigned 24-bit big-endian",
130 PCMDEF(u24le, "PCM
unsigned 24-bit little-endian",
133 PCMDEF(u16be, "PCM
unsigned 16-bit big-endian",
136 PCMDEF(u16le, "PCM
unsigned 16-bit little-endian",
139 PCMDEF(u8, "PCM
unsigned 8-bit",
145 PCMDEF(mulaw, "PCM mu-law",
148 static const
AVOption sln_options[] = {
157 .option = sln_options,
171 .priv_class = &sln_demuxer_class,
#define PCMDEF(name_, long_name_, ext, codec)
#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.
static const AVClass sln_demuxer_class
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.
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
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
int sample_rate
Audio only.
struct AVInputFormat * iformat
The input container format.
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