91 return 2048 * channels;
95 return (block_align - 4 * channels) * 8 / (4 * channels) + 1;
97 return (block_align - 7 * channels) * 2 / channels + 2;
110 int64_t chunk_size = 0;
130 av_log(s,
AV_LOG_ERROR,
"Muxing variable packet size not supported on non seekable output\n");
183 chunk_size += strlen(t->
key) + strlen(t->
value) + 2;
211 if (alloc_size < 0) {
222 for (i = 4; i > 0; i--) {
223 unsigned top = pkt->
size >> i * 7;
264 .mime_type =
"audio/x-caf",
void avio_wb64(AVIOContext *s, uint64_t val)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
This struct describes the properties of an encoded stream.
int frame_size
Audio only.
void avio_wl32(AVIOContext *s, unsigned int val)
AVStream ** streams
A list of all streams in the file.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
uint64_t channel_layout
Audio only.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
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.
static int caf_write_header(AVFormatContext *s)
#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
int extradata_size
Size of the extradata content in bytes.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int block_align
Audio only.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
AVOutputFormat ff_caf_muxer
static int write_trailer(AVFormatContext *s1)
static uint32_t samples_per_packet(enum AVCodecID codec_id, int channels, int block_align)
static uint32_t codec_flags(enum AVCodecID codec_id)
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
static int caf_write_packet(AVFormatContext *s, AVPacket *pkt)
void avio_wb16(AVIOContext *s, unsigned int val)
static int caf_write_trailer(AVFormatContext *s)
int sample_rate
Audio only.
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
as in Berlin toast format
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
void avio_wb32(AVIOContext *s, unsigned int val)
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
AVCodecParameters * codecpar
const AVCodecTag ff_codec_caf_tags[]
Known codec tags for CAF.
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)