28 #define RAW_SAMPLES 1024
94 #define PCMDEF(name_, long_name_, ext, codec) \
95 static const AVClass name_ ## _demuxer_class = { \
96 .class_name = #name_ " demuxer", \
97 .item_name = av_default_item_name, \
98 .option = pcm_options, \
99 .version = LIBAVUTIL_VERSION_INT, \
101 AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
103 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
104 .priv_data_size = sizeof(PCMAudioDemuxerContext), \
105 .read_header = pcm_read_header, \
106 .read_packet = pcm_read_packet, \
107 .read_seek = ff_pcm_read_seek, \
108 .flags = AVFMT_GENERIC_INDEX, \
110 .raw_codec_id = codec, \
111 .priv_class = &name_ ## _demuxer_class, \
114 PCMDEF(f64be,
"PCM 64-bit floating-point big-endian",
117 PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
120 PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
123 PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
126 PCMDEF(s32be, "PCM
signed 32-bit big-endian",
129 PCMDEF(s32le, "PCM
signed 32-bit little-endian",
132 PCMDEF(s24be, "PCM
signed 24-bit big-endian",
135 PCMDEF(s24le, "PCM
signed 24-bit little-endian",
138 PCMDEF(s16be, "PCM
signed 16-bit big-endian",
141 PCMDEF(s16le, "PCM
signed 16-bit little-endian",
144 PCMDEF(s8, "PCM
signed 8-bit",
147 PCMDEF(u32be, "PCM
unsigned 32-bit big-endian",
150 PCMDEF(u32le, "PCM
unsigned 32-bit little-endian",
153 PCMDEF(u24be, "PCM
unsigned 24-bit big-endian",
156 PCMDEF(u24le, "PCM
unsigned 24-bit little-endian",
159 PCMDEF(u16be, "PCM
unsigned 16-bit big-endian",
162 PCMDEF(u16le, "PCM
unsigned 16-bit little-endian",
165 PCMDEF(u8, "PCM
unsigned 8-bit",
171 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...
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#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.
void av_log(void *avcl, int level, const char *fmt,...)
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.
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.
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...