37 #define AU_UNKNOWN_SIZE ((uint32_t)(~0))
39 #define AU_HEADER_SIZE (24+8)
62 if (p->
buf[0] ==
'.' && p->
buf[1] ==
's' &&
63 p->
buf[2] ==
'n' && p->
buf[3] ==
'd')
69 #define BLOCK_SIZE 1024
73 int size, data_size = 0;
76 unsigned int id, channels, rate;
82 if (tag !=
MKTAG(
'.',
's',
'n',
'd'))
110 if (
id ==
MKBETAG(
'7',
'2',
'6',
'2')) {
113 const uint8_t bpcss[] = {4, 0, 3, 5};
115 bps = bpcss[
id - 23];
122 if (channels == 0 || channels >= INT_MAX / (
BLOCK_SIZE * bps >> 3)) {
127 if (rate == 0 || rate > INT_MAX) {
155 .read_probe = au_probe,
156 .read_header = au_read_header,
201 if (s->
pb->
seekable && file_size < INT32_MAX) {
215 .mime_type =
"audio/basic",
219 .write_header = au_write_header,
221 .write_trailer = au_write_trailer,
void avio_wb64(AVIOContext *s, uint64_t val)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned int avio_rb32(AVIOContext *s)
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.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
AVCodecID
Identify the syntax and semantics of the bitstream.
#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.
unsigned int avio_rl32(AVIOContext *s)
#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.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
static const AVCodecTag codec_au_tags[]
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
#define MKBETAG(a, b, c, d)
int channels
number of audio channels
void avio_wb32(AVIOContext *s, unsigned int val)
#define MKTAG(a, b, c, d)