26 #include "libavutil/intfloat.h"
27 #include "libavutil/dict.h"
90 return 2048 * channels;
94 return (1024 - 4 * channels) * 8 / (4 * channels) + 1;
96 return (1024 - 7 * channels) * 2 / channels + 2;
109 int64_t chunk_size = 0;
132 codec_tag =
MKTAG(
'l',
'p',
'c',
'm');
141 av_log(s,
AV_LOG_ERROR,
"Muxing variable packet size not supported on non seekable output\n");
190 chunk_size += strlen(t->
key) + strlen(t->
value) + 2;
218 if (alloc_size < 0) {
229 for (i = 4; i > 0; i--) {
230 unsigned top = pkt->
size >> i * 7;
271 .mime_type =
"audio/x-caf",
#define AVERROR_PATCHWELCOME
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
AVCodecContext * codec
Codec context associated with this stream.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
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.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static int caf_write_header(AVFormatContext *s)
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
preferred ID for decoding MPEG audio layer 1, 2 or 3
uint64_t channel_layout
Audio channel layout.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
AVOutputFormat ff_caf_muxer
static int write_trailer(AVFormatContext *s1)
static uint32_t codec_flags(enum AVCodecID codec_id)
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
int sample_rate
samples per second
main external API structure.
AVIOContext * pb
I/O context.
#define MKTAG(a, b, c, d)
static int caf_write_packet(AVFormatContext *s, AVPacket *pkt)
static int caf_write_trailer(AVFormatContext *s)
static uint32_t samples_per_packet(enum AVCodecID codec_id, int channels)
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
#define AVERROR_INVALIDDATA
as in Berlin toast format
int channels
number of audio channels
static void write_header(FFV1Context *f)
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
#define AV_DICT_IGNORE_SUFFIX
const AVCodecTag ff_codec_caf_tags[]
Known codec tags for CAF.
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)