Go to the documentation of this file.
33 #define AIFF_C_VERSION1 0xA2805140
101 unsigned int num_frames;
115 if (exp <-63 || exp >63) {
204 if (p->
buf[0] ==
'F' && p->
buf[1] ==
'O' &&
205 p->
buf[2] ==
'R' && p->
buf[3] ==
'M' &&
206 p->
buf[8] ==
'A' && p->
buf[9] ==
'I' &&
207 p->
buf[10] ==
'F' && (p->
buf[11] ==
'F' || p->
buf[11] ==
'C'))
217 int64_t
offset = 0, position;
227 if (filesize < 0 ||
tag !=
MKTAG(
'F',
'O',
'R',
'M'))
232 if (
tag ==
MKTAG(
'A',
'I',
'F',
'F'))
234 else if (
tag !=
MKTAG(
'A',
'I',
'F',
'C'))
243 while (filesize > 0) {
254 if (
size >= 0x7fffffff - 8)
257 filesize -=
size + 8;
260 case MKTAG(
'C',
'O',
'M',
'M'):
268 case MKTAG(
'I',
'D',
'3',
' '):
271 if (id3v2_extra_meta)
281 case MKTAG(
'F',
'V',
'E',
'R'):
284 case MKTAG(
'N',
'A',
'M',
'E'):
287 case MKTAG(
'A',
'U',
'T',
'H'):
290 case MKTAG(
'(',
'c',
')',
' '):
293 case MKTAG(
'A',
'N',
'N',
'O'):
296 case MKTAG(
'S',
'S',
'N',
'D'):
311 case MKTAG(
'w',
'a',
'v',
'e'):
312 if ((uint64_t)
size > (1<<30))
337 case MKTAG(
'C',
'H',
'A',
'N'):
341 case MKTAG(
'A',
'P',
'C',
'M'):
389 #define MAX_SIZE 4096
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
@ AV_CODEC_ID_ADPCM_IMA_QT
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
This struct describes the properties of an encoded stream.
int ff_replaygain_export(AVStream *st, AVDictionary *metadata)
Parse replaygain tags and export them as per-stream side data.
#define AVERROR_EOF
End of file.
#define MKTAG(a, b, c, d)
static int aiff_read_packet(AVFormatContext *s, AVPacket *pkt)
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
Read an ID3v2 tag, including supported extra metadata.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *extra_meta)
Create chapters for all CHAP tags found in the ID3v2 header.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static double val(void *priv, double ch)
int64_t duration
Decoding: duration of the stream, in stream time base.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
const AVCodecTag ff_codec_aiff_tags[]
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static void get_meta(AVFormatContext *s, const char *key, int size)
static int aiff_probe(const AVProbeData *p)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
@ AV_CODEC_ID_ADPCM_IMA_WS
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta *extra_meta)
Create a stream for each APIC (attached picture) extracted from the ID3v2 header.
uint64_t avio_rb64(AVIOContext *s)
This structure contains the data a format has to probe a file.
int sample_rate
Audio only.
@ AV_CODEC_ID_GSM
as in Berlin toast format
int64_t nb_frames
number of frames in this stream if known or 0
AVCodecID
Identify the syntax and semantics of the bitstream.
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.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
#define ID3v2_DEFAULT_MAGIC
Default magic bytes for ID3v2 header: "ID3".
static enum AVCodecID aiff_codec_get_id(int bps)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int flags
A combination of AV_PKT_FLAG values.
AVInputFormat ff_aiff_demuxer
static int get_tag(AVIOContext *pb, uint32_t *tag)
int block_align
Audio only.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
@ AV_CODEC_ID_ADPCM_G726LE
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
const AVCodecTag *const ff_aiff_codec_tags_list[]
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
static int get_aiff_header(AVFormatContext *s, int size, unsigned version)
#define av_fourcc2str(fourcc)
int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, int64_t size)
Read 'chan' tag from the input stream.
static int aiff_read_header(AVFormatContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.