Go to the documentation of this file.
30 #include "config_components.h"
44 #define AU_UNKNOWN_SIZE ((uint32_t)(~0))
82 static const char keys[][7] = {
90 enum { PARSE_KEY, PARSE_VALUE, PARSE_FINISHED }
state = PARSE_KEY;
109 state = PARSE_FINISHED;
110 }
else if (
c ==
'=') {
121 if (
c ==
'\0' ||
c ==
'\n') {
136 state = (
c ==
'\0') ? PARSE_FINISHED : PARSE_KEY;
153 #define BLOCK_SIZE 1024
157 int size, data_size = 0;
167 if (
tag !=
MKTAG(
'.',
's',
'n',
'd'))
183 ret = au_read_annotation(
s,
size - 24);
197 if (
id ==
MKBETAG(
'7',
'2',
'6',
'2')) {
200 const uint8_t bpcss[] = {4, 0, 3, 5};
203 bps = bpcss[
id - 23];
215 if (rate == 0 || rate > INT_MAX) {
244 .read_probe = au_probe,
245 .read_header = au_read_header,
254 typedef struct AUContext {
255 uint32_t header_size;
262 static const char keys[][7] = {
290 AUContext *au =
s->priv_data;
293 AVBPrint annotations;
302 ret = au_get_annotations(
s, &annotations);
305 au->header_size = 24 + annotations.len & ~7;
313 avio_write(pb, annotations.str, annotations.len & ~7);
324 AUContext *au =
s->priv_data;
330 avio_wb32(pb, (uint32_t)(file_size - au->header_size));
340 .p.mime_type =
"audio/basic",
341 .p.extensions =
"au",
348 .priv_data_size =
sizeof(AUContext),
#define AV_BPRINT_SIZE_UNLIMITED
static const AVCodecTag codec_au_tags[]
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
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
enum AVMediaType codec_type
General type of the encoded data.
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
This struct describes the properties of an encoded stream.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int buf_size
Size of buf except extra allocated bytes.
int nb_channels
Number of channels in this layout.
static const AVCodecTag *const au_codec_tags[]
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
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...
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int write_trailer(AVFormatContext *s1)
This structure contains the data a format has to probe a file.
AVChannelLayout ch_layout
Audio only.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int sample_rate
Audio only.
AVCodecID
Identify the syntax and semantics of the bitstream.
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 av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define MKBETAG(a, b, c, d)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wb32(AVIOContext *s, unsigned int val)
int avio_r8(AVIOContext *s)
#define i(width, name, range_min, range_max)
int block_align
Audio only.
#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....
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 default value
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
@ AV_CODEC_ID_ADPCM_G726LE
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
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).
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
static void write_header(FFV1Context *f)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.