33#define FRAME_SIZE_OFFSET 40
158 av_log(
s,
AV_LOG_ERROR,
"Muxing variable packet size not supported on non seekable output\n");
167 av_log(
s,
AV_LOG_ERROR,
"Muxing variable frame size not supported on non seekable output\n");
220 chunk_size += strlen(t->
key) + strlen(t->
value) + 2;
241 for (
int j = 4; j > 0; j--) {
242 unsigned top = num >> j * 7;
244 *(buf++) = top | 128;
246 *(buf++) = num & 127;
256#if SIZE_MAX - 10 < UINT_MAX
298 valid_frames -= remainder_frames;
324 .p.mime_type =
"audio/x-caf",
325 .p.extensions =
"caf",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
void avio_wl32(AVIOContext *s, unsigned int val)
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
void avio_wb16(AVIOContext *s, unsigned int val)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_wb64(AVIOContext *s, uint64_t val)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
const AVCodecTag *const ff_caf_codec_tags_list[]
const AVCodecTag ff_codec_caf_tags[]
Known codec tags for CAF.
static uint32_t samples_per_packet(const AVCodecParameters *par)
static void caf_write_deinit(AVFormatContext *s)
static int caf_write_packet(AVFormatContext *s, AVPacket *pkt)
static int caf_write_trailer(AVFormatContext *s)
static uint32_t codec_flags(enum AVCodecID codec_id)
static uint8_t * put_variable_length_num(uint8_t *buf, uint32_t num)
static int caf_write_header(AVFormatContext *s)
static int caf_write_init(struct AVFormatContext *s)
static const uint8_t frame_size[4]
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_GSM
as in Berlin toast format
@ AV_CODEC_ID_ADPCM_IMA_QT
@ AV_CODEC_ID_ADPCM_IMA_WAV
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
@ AV_CHANNEL_ORDER_NATIVE
The native channel order, i.e.
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
int ff_standardize_creation_time(AVFormatContext *s)
Standardize creation_time metadata in AVFormatContext to an ISO-8601 timestamp string.
enum AVChannelOrder order
Channel order used in this layout.
uint64_t mask
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC ...
union AVChannelLayout::@162063043056170047076125117143030261346263330336 u
Details about which channels are present in this layout.
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
int extradata_size
Size of the extradata content in bytes.
int frame_size
Audio frame size, if known.
AVChannelLayout ch_layout
The channel layout and number of channels.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
int initial_padding
Number of padding audio samples at the start.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
This structure stores compressed data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
unsigned pakt_buf_alloc_size