30 #define AIFF_C_VERSION1 0xA2805140
94 unsigned int num_frames;
105 sample_rate = ldexp(val, exp - 16383 - 63);
167 if (p->
buf[0] ==
'F' && p->
buf[1] ==
'O' &&
168 p->
buf[2] ==
'R' && p->
buf[3] ==
'M' &&
169 p->
buf[8] ==
'A' && p->
buf[9] ==
'I' &&
170 p->
buf[10] ==
'F' && (p->
buf[11] ==
'F' || p->
buf[11] ==
'C'))
190 if (filesize < 0 || tag !=
MKTAG(
'F',
'O',
'R',
'M'))
195 if (tag ==
MKTAG(
'A',
'I',
'F',
'F'))
197 else if (tag !=
MKTAG(
'A',
'I',
'F',
'C'))
206 while (filesize > 0) {
212 filesize -= size + 8;
215 case MKTAG(
'C',
'O',
'M',
'M'):
223 case MKTAG(
'F',
'V',
'E',
'R'):
226 case MKTAG(
'N',
'A',
'M',
'E'):
229 case MKTAG(
'A',
'U',
'T',
'H'):
232 case MKTAG(
'(',
'c',
')',
' '):
235 case MKTAG(
'A',
'N',
'N',
'O'):
238 case MKTAG(
'S',
'S',
'N',
'D'):
251 case MKTAG(
'w',
'a',
'v',
'e'):
252 if ((uint64_t)size > (1<<30))
285 #define MAX_SIZE 4096
305 size =
FFMIN(max_size, size);
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
unsigned int avio_rb32(AVIOContext *s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int aiff_read_packet(AVFormatContext *s, AVPacket *pkt)
static int read_header(FFV1Context *f)
#define AVERROR_EOF
End of file.
uint64_t avio_rb64(AVIOContext *s)
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).
int av_get_bits_per_sample(enum CodecID codec_id)
Return codec bits per sample.
enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static void get_meta(AVFormatContext *s, const char *key, int size)
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
AVCodecContext * codec
codec context
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and chilren.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_probe(AVProbeData *p)
static int aiff_probe(AVProbeData *p)
as in Berlin toast format
static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec, int size, unsigned version)
static int get_tag(AVIOContext *pb, uint32_t *tag)
int frame_size
Samples per packet, initialized when calling 'init'.
enum AVMediaType codec_type
int sample_rate
samples per second
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static int aiff_read_header(AVFormatContext *s, AVFormatParameters *ap)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
AVInputFormat ff_aiff_demuxer
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
static const AVCodecTag ff_codec_aiff_tags[]
int64_t nb_frames
number of frames in this stream if known or 0
CodecID
Identify the syntax and semantics of the bitstream.
static enum CodecID aiff_codec_get_id(int bps)
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
common header for AIFF muxer and demuxer
#define MKTAG(a, b, c, d)