115 if (skip < 0 || !st->codec->extradata ||
122 #define ALAC_PREAMBLE 12
123 #define ALAC_HEADER 36
153 int64_t pos = 0, ccount;
167 for (i = 0; i < num_packets; i++) {
188 for (i = 0; i < nb_entries; i++) {
241 caf->
data_size = size < 0 ? -1 : size - 4;
264 #define _(x) ((x) >= ' ' ? (x) : ' ')
266 tag,
_(tag>>24),
_((tag>>16)&0xFF),
_((tag>>8)&0xFF),
_(tag&0xFF));
287 "block size or frame size are variable.\n");
301 #define CAF_MAX_PKT_SIZE 4096
308 int res, pkt_size = 0, pkt_frames = 0;
324 if (pkt_size > 0 && pkt_frames == 1) {
326 pkt_size =
FFMIN(pkt_size, left);
340 if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left)
358 int64_t timestamp,
int flags)
364 timestamp =
FFMAX(timestamp, 0);
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.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
static int read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t data_size
raw data size, in bytes
AV_WL32 AV_WL24 AV_WL16 AV_RB32
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
int64_t data_start
data start position, in bytes
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
static int read_kuki_chunk(AVFormatContext *s, int64_t size)
Read magic cookie chunk.
int64_t num_bytes
total number of bytes in stream
unsigned int avio_rb32(AVIOContext *s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
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).
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.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
int ff_mp4_read_descr_len(AVIOContext *pb)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
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
static int read_header(AVFormatContext *s, AVFormatParameters *ap)
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
AVInputFormat ff_caf_demuxer
static int read_probe(AVProbeData *p)
enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
Compute codec id for 'lpcm' tag.
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)
enum AVMediaType codec_type
int sample_rate
samples per second
int bytes_per_packet
bytes in a packet, or 0 if variable
#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').
int64_t packet_cnt
packet counter
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 void read_info_chunk(AVFormatContext *s, int64_t size)
Read information chunk.
#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.
static int read_pakt_chunk(AVFormatContext *s, int64_t size)
Read packet table chunk.
static int probe(AVProbeData *p)
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 stream time base.
int64_t nb_frames
number of frames in this stream if known or 0
#define MKBETAG(a, b, c, d)
int eof_reached
true if eof reached
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...
int64_t frame_cnt
frame counter
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
static int read_desc_chunk(AVFormatContext *s)
Read audio description chunk.
const AVCodecTag ff_codec_caf_tags[]
Known codec tags for CAF.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int frames_per_packet
frames in a packet, or 0 if variable