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
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
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.
#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.
enum AVMediaType codec_type
General type of the encoded data.
static const AVOption pcm_options[]
int block_align
Audio only.
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
int sample_rate
Audio only.
struct AVInputFormat * iformat
The input container format.
void * priv_data
Format private data.
int bits_per_coded_sample
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
AVCodecParameters * codecpar
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...