30#include "config_components.h"
45#define AU_UNKNOWN_SIZE ((uint32_t)(~0))
70 if (
p->buf_size < 24 ||
83 static const char keys[][7] = {
91 enum { PARSE_KEY, PARSE_VALUE, PARSE_FINISHED }
state = PARSE_KEY;
110 state = PARSE_FINISHED;
111 }
else if (
c ==
'=') {
122 if (
c ==
'\0' ||
c ==
'\n') {
137 state = (
c ==
'\0') ? PARSE_FINISHED : PARSE_KEY;
154#define BLOCK_SIZE 1024
158 int size, data_size = 0;
168 if (
tag !=
MKTAG(
'.',
's',
'n',
'd'))
184 ret = au_read_annotation(
s,
size - 24);
198 if (
id ==
MKBETAG(
'7',
'2',
'6',
'2')) {
201 const uint8_t bpcss[] = {4, 0, 3, 5};
204 bps = bpcss[
id - 23];
216 if (rate == 0 || rate > INT_MAX) {
245 .read_probe = au_probe,
246 .read_header = au_read_header,
255typedef struct AUContext {
256 uint32_t header_size;
263 static const char keys[][7] = {
307 "Sun AU has no standard encoding for 2-bit G.726LE; "
308 "writing non-standard '7262' tag\n");
322 "Unsupported G.726LE bit width %"PRId64
"\n",
bps);
331 AUContext *au =
s->priv_data;
334 AVBPrint annotations;
337 ret = au_g726le_tag(
s, par);
349 ret = au_get_annotations(
s, &annotations);
352 au->header_size = 24 + annotations.len & ~7;
360 avio_write(pb, annotations.str, annotations.len & ~7);
371 AUContext *au =
s->priv_data;
387 .p.mime_type =
"audio/basic",
388 .p.extensions =
"au",
395 .priv_data_size =
sizeof(AUContext),
static const AVCodecTag *const au_codec_tags[]
static const AVCodecTag codec_au_tags[]
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
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_wb32(AVIOContext *s, unsigned int val)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl32(AVIOContext *s)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AV_BPRINT_SIZE_UNLIMITED
#define i(width, name, range_min, range_max)
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
static void write_header(FFV1Context *f)
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_ADPCM_G726LE
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#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_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKTAG(a, b, c, d)
#define MKBETAG(a, b, c, d)
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....
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
#define FF_ARRAY_ELEMS(a)
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
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 presentation order, in stream time base.
#define avpriv_request_sample(...)
static struct @232240247175332074307271266321204261331170211232 state
static int write_trailer(AVFormatContext *s1)