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)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
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.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
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. ...
simple assert() macros that are a bit more flexible than ISO C assert().
AVCodecContext * codec
Codec context associated with this stream.
static const AVOption pcm_options[]
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
int sample_rate
samples per second
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
struct AVInputFormat * iformat
The input container format.
int channels
number of audio channels
void * priv_data
Format private data.
AVInputFormat ff_sln_demuxer