28 #define RAW_SAMPLES 1024
90 #define PCMDEF(name_, long_name_, ext, codec) \
91 static const AVClass name_ ## _demuxer_class = { \
92 .class_name = #name_ " demuxer", \
93 .item_name = av_default_item_name, \
94 .option = pcm_options, \
95 .version = LIBAVUTIL_VERSION_INT, \
97 AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
99 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
100 .priv_data_size = sizeof(PCMAudioDemuxerContext), \
101 .read_header = pcm_read_header, \
102 .read_packet = pcm_read_packet, \
103 .read_seek = ff_pcm_read_seek, \
104 .flags = AVFMT_GENERIC_INDEX, \
106 .raw_codec_id = codec, \
107 .priv_class = &name_ ## _demuxer_class, \
110 PCMDEF(f64be,
"PCM 64-bit floating-point big-endian",
113 PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
116 PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
119 PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
122 PCMDEF(s32be, "PCM
signed 32-bit big-endian",
125 PCMDEF(s32le, "PCM
signed 32-bit little-endian",
128 PCMDEF(s24be, "PCM
signed 24-bit big-endian",
131 PCMDEF(s24le, "PCM
signed 24-bit little-endian",
134 PCMDEF(s16be, "PCM
signed 16-bit big-endian",
137 PCMDEF(s16le, "PCM
signed 16-bit little-endian",
140 PCMDEF(s8, "PCM
signed 8-bit",
143 PCMDEF(u32be, "PCM
unsigned 32-bit big-endian",
146 PCMDEF(u32le, "PCM
unsigned 32-bit little-endian",
149 PCMDEF(u24be, "PCM
unsigned 24-bit big-endian",
152 PCMDEF(u24le, "PCM
unsigned 24-bit little-endian",
155 PCMDEF(u16be, "PCM
unsigned 16-bit big-endian",
158 PCMDEF(u16le, "PCM
unsigned 16-bit little-endian",
161 PCMDEF(u8, "PCM
unsigned 8-bit",
167 PCMDEF(mulaw, "PCM mu-law",
static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
#define PCMDEF(name_, long_name_, ext, codec)
static int pcm_read_header(AVFormatContext *s)
int64_t pos
byte position in stream, -1 if unknown
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
AVCodecContext * codec
Codec context associated with this stream.
static const AVOption pcm_options[]
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
#define AV_OPT_FLAG_DECODING_PARAM
Describe the class of an AVClass context structure.
struct PCMAudioDemuxerContext PCMAudioDemuxerContext
struct AVInputFormat * iformat
Can only be iformat or oformat, not both at the same time.
int channels
number of audio channels
void * priv_data
Format private data.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...