FFmpeg
au.c
Go to the documentation of this file.
1 /*
2  * AU muxer and demuxer
3  * Copyright (c) 2001 Fabrice Bellard
4  *
5  * first version by Francois Revol <revol@free.fr>
6  *
7  * This file is part of FFmpeg.
8  *
9  * FFmpeg is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * FFmpeg is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with FFmpeg; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 /*
25  * Reference documents:
26  * http://www.opengroup.org/public/pubs/external/auformat.html
27  * http://www.goice.co.jp/member/mo/formats/au.html
28  */
29 
30 #include "config_components.h"
31 
32 #include "libavutil/bprint.h"
33 #include "libavutil/intreadwrite.h"
34 #include "avformat.h"
35 #include "demux.h"
36 #include "internal.h"
37 #include "avio_internal.h"
38 #include "mux.h"
39 #include "pcm.h"
40 #include "libavutil/avassert.h"
41 
42 /* if we don't know the size in advance */
43 #define AU_UNKNOWN_SIZE ((uint32_t)(~0))
44 
45 static const AVCodecTag codec_au_tags[] = {
46  { AV_CODEC_ID_PCM_MULAW, 1 },
47  { AV_CODEC_ID_PCM_S8, 2 },
48  { AV_CODEC_ID_PCM_S16BE, 3 },
49  { AV_CODEC_ID_PCM_S24BE, 4 },
50  { AV_CODEC_ID_PCM_S32BE, 5 },
51  { AV_CODEC_ID_PCM_F32BE, 6 },
52  { AV_CODEC_ID_PCM_F64BE, 7 },
57  { AV_CODEC_ID_PCM_ALAW, 27 },
58  { AV_CODEC_ID_ADPCM_G726LE, MKBETAG('7','2','6','2') },
59  { AV_CODEC_ID_NONE, 0 },
60 };
61 
62 static const AVCodecTag *const au_codec_tags[] = { codec_au_tags, NULL };
63 
64 #if CONFIG_AU_DEMUXER
65 
66 static int au_probe(const AVProbeData *p)
67 {
68  if (p->buf_size < 24 ||
69  AV_RL32(p->buf) != MKTAG('.', 's', 'n', 'd') ||
70  AV_RN32(p->buf+4) == 0 ||
71  AV_RN32(p->buf+8) == 0 ||
72  AV_RN32(p->buf+12) == 0 ||
73  AV_RN32(p->buf+16) == 0 ||
74  AV_RN32(p->buf+20) == 0)
75  return 0;
76  return AVPROBE_SCORE_MAX;
77 }
78 
79 static int au_read_annotation(AVFormatContext *s, int size)
80 {
81  static const char keys[][7] = {
82  "title",
83  "artist",
84  "album",
85  "track",
86  "genre",
87  };
88  AVIOContext *pb = s->pb;
89  enum { PARSE_KEY, PARSE_VALUE, PARSE_FINISHED } state = PARSE_KEY;
90  char c;
91  AVBPrint bprint;
92  char * key = NULL;
93  char * value = NULL;
94  int ret, i;
95 
97 
98  while (size-- > 0) {
99  if (avio_feof(pb)) {
100  av_bprint_finalize(&bprint, NULL);
101  av_freep(&key);
102  return AVERROR_EOF;
103  }
104  c = avio_r8(pb);
105  switch(state) {
106  case PARSE_KEY:
107  if (c == '\0') {
108  state = PARSE_FINISHED;
109  } else if (c == '=') {
110  ret = av_bprint_finalize(&bprint, &key);
111  if (ret < 0)
112  return ret;
114  state = PARSE_VALUE;
115  } else {
116  av_bprint_chars(&bprint, c, 1);
117  }
118  break;
119  case PARSE_VALUE:
120  if (c == '\0' || c == '\n') {
121  if (av_bprint_finalize(&bprint, &value) != 0) {
122  av_log(s, AV_LOG_ERROR, "Memory error while parsing AU metadata.\n");
123  } else {
125  for (i = 0; i < FF_ARRAY_ELEMS(keys); i++) {
126  if (av_strcasecmp(keys[i], key) == 0) {
127  av_dict_set(&(s->metadata), keys[i], value, AV_DICT_DONT_STRDUP_VAL);
128  value = NULL;
129  break;
130  }
131  }
132  }
133  av_freep(&key);
134  av_freep(&value);
135  state = (c == '\0') ? PARSE_FINISHED : PARSE_KEY;
136  } else {
137  av_bprint_chars(&bprint, c, 1);
138  }
139  break;
140  case PARSE_FINISHED:
141  break;
142  default:
143  /* should never happen */
144  av_assert0(0);
145  }
146  }
147  av_bprint_finalize(&bprint, NULL);
148  av_freep(&key);
149  return 0;
150 }
151 
152 #define BLOCK_SIZE 1024
153 
154 static int au_read_header(AVFormatContext *s)
155 {
156  int size, data_size = 0;
157  unsigned int tag;
158  AVIOContext *pb = s->pb;
159  unsigned int id, channels, rate;
160  int bps, ba = 0;
161  enum AVCodecID codec;
162  AVStream *st;
163  int ret;
164 
165  tag = avio_rl32(pb);
166  if (tag != MKTAG('.', 's', 'n', 'd'))
167  return AVERROR_INVALIDDATA;
168  size = avio_rb32(pb); /* header size */
169  data_size = avio_rb32(pb); /* data size in bytes */
170 
171  if (data_size < 0 && data_size != AU_UNKNOWN_SIZE) {
172  av_log(s, AV_LOG_ERROR, "Invalid negative data size '%d' found\n", data_size);
173  return AVERROR_INVALIDDATA;
174  }
175 
176  id = avio_rb32(pb);
177  rate = avio_rb32(pb);
178  channels = avio_rb32(pb);
179 
180  if (size > 24) {
181  /* parse annotation field to get metadata */
182  ret = au_read_annotation(s, size - 24);
183  if (ret < 0)
184  return ret;
185  }
186 
187  codec = ff_codec_get_id(codec_au_tags, id);
188 
189  if (codec == AV_CODEC_ID_NONE) {
190  avpriv_request_sample(s, "unknown or unsupported codec tag: %u", id);
191  return AVERROR_PATCHWELCOME;
192  }
193 
194  bps = av_get_bits_per_sample(codec);
195  if (codec == AV_CODEC_ID_ADPCM_G726LE) {
196  if (id == MKBETAG('7','2','6','2')) {
197  bps = 2;
198  } else {
199  const uint8_t bpcss[] = {4, 0, 3, 5};
200  av_assert0(id >= 23 && id < 23 + 4);
201  ba = bpcss[id - 23];
202  bps = bpcss[id - 23];
203  }
204  } else if (!bps) {
205  avpriv_request_sample(s, "Unknown bits per sample");
206  return AVERROR_PATCHWELCOME;
207  }
208 
209  if (channels == 0 || channels >= INT_MAX / (BLOCK_SIZE * bps >> 3)) {
210  av_log(s, AV_LOG_ERROR, "Invalid number of channels %u\n", channels);
211  return AVERROR_INVALIDDATA;
212  }
213 
214  if (rate == 0 || rate > INT_MAX) {
215  av_log(s, AV_LOG_ERROR, "Invalid sample rate: %u\n", rate);
216  return AVERROR_INVALIDDATA;
217  }
218 
219  st = avformat_new_stream(s, NULL);
220  if (!st)
221  return AVERROR(ENOMEM);
223  st->codecpar->codec_tag = id;
224  st->codecpar->codec_id = codec;
226  st->codecpar->sample_rate = rate;
228  st->codecpar->bit_rate = channels * rate * bps;
229  st->codecpar->block_align = ba ? ba : FFMAX(bps * channels / 8, 1);
230  if (data_size != AU_UNKNOWN_SIZE)
231  st->duration = (((int64_t)data_size)<<3) / (channels * (int64_t)bps);
232 
233  st->start_time = 0;
234  avpriv_set_pts_info(st, 64, 1, rate);
235 
236  return 0;
237 }
238 
240  .p.name = "au",
241  .p.long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
242  .p.codec_tag = au_codec_tags,
243  .read_probe = au_probe,
244  .read_header = au_read_header,
245  .read_packet = ff_pcm_read_packet,
246  .read_seek = ff_pcm_read_seek,
247 };
248 
249 #endif /* CONFIG_AU_DEMUXER */
250 
251 #if CONFIG_AU_MUXER
252 
253 typedef struct AUContext {
254  uint32_t header_size;
255 } AUContext;
256 
257 #include "rawenc.h"
258 
259 static int au_get_annotations(AVFormatContext *s, AVBPrint *annotations)
260 {
261  static const char keys[][7] = {
262  "Title",
263  "Artist",
264  "Album",
265  "Track",
266  "Genre",
267  };
268  int cnt = 0;
269  AVDictionary *m = s->metadata;
270  AVDictionaryEntry *t = NULL;
271 
272  for (int i = 0; i < FF_ARRAY_ELEMS(keys); i++) {
273  t = av_dict_get(m, keys[i], NULL, 0);
274  if (t != NULL) {
275  if (cnt++)
276  av_bprint_chars(annotations, '\n', 1);
277  av_bprintf(annotations, "%s=%s", keys[i], t->value);
278  }
279  }
280  /* The specification requires the annotation field to be zero-terminated
281  * and its length to be a multiple of eight, so pad with 0's */
282  av_bprint_chars(annotations, '\0', 8);
283  return av_bprint_is_complete(annotations) ? 0 : AVERROR(ENOMEM);
284 }
285 
286 static int au_write_header(AVFormatContext *s)
287 {
288  int ret;
289  AUContext *au = s->priv_data;
290  AVIOContext *pb = s->pb;
291  AVCodecParameters *par = s->streams[0]->codecpar;
292  AVBPrint annotations;
293 
295  if (!par->codec_tag) {
296  av_log(s, AV_LOG_ERROR, "unsupported codec\n");
297  return AVERROR(EINVAL);
298  }
299 
300  av_bprint_init(&annotations, 0, INT_MAX - 24);
301  ret = au_get_annotations(s, &annotations);
302  if (ret < 0)
303  goto fail;
304  au->header_size = 24 + annotations.len & ~7;
305 
306  ffio_wfourcc(pb, ".snd"); /* magic number */
307  avio_wb32(pb, au->header_size); /* header size */
308  avio_wb32(pb, AU_UNKNOWN_SIZE); /* data size */
309  avio_wb32(pb, par->codec_tag); /* codec ID */
310  avio_wb32(pb, par->sample_rate);
311  avio_wb32(pb, par->ch_layout.nb_channels);
312  avio_write(pb, annotations.str, annotations.len & ~7);
313 
314 fail:
315  av_bprint_finalize(&annotations, NULL);
316 
317  return ret;
318 }
319 
320 static int au_write_trailer(AVFormatContext *s)
321 {
322  AVIOContext *pb = s->pb;
323  AUContext *au = s->priv_data;
324  int64_t file_size = avio_tell(pb);
325 
326  if ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) && file_size < INT32_MAX) {
327  /* update file size */
328  avio_seek(pb, 8, SEEK_SET);
329  avio_wb32(pb, (uint32_t)(file_size - au->header_size));
330  avio_seek(pb, file_size, SEEK_SET);
331  }
332 
333  return 0;
334 }
335 
336 const FFOutputFormat ff_au_muxer = {
337  .p.name = "au",
338  .p.long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
339  .p.mime_type = "audio/basic",
340  .p.extensions = "au",
341  .p.codec_tag = au_codec_tags,
342  .p.audio_codec = AV_CODEC_ID_PCM_S16BE,
343  .p.video_codec = AV_CODEC_ID_NONE,
344  .p.subtitle_codec = AV_CODEC_ID_NONE,
345  .p.flags = AVFMT_NOTIMESTAMPS,
346  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH,
347  .priv_data_size = sizeof(AUContext),
348  .write_header = au_write_header,
350  .write_trailer = au_write_trailer,
351 };
352 
353 #endif /* CONFIG_AU_MUXER */
ff_au_muxer
const FFOutputFormat ff_au_muxer
AV_BPRINT_SIZE_UNLIMITED
#define AV_BPRINT_SIZE_UNLIMITED
AV_CODEC_ID_PCM_F32BE
@ AV_CODEC_ID_PCM_F32BE
Definition: codec_id.h:348
codec_au_tags
static const AVCodecTag codec_au_tags[]
Definition: au.c:45
AVOutputFormat::name
const char * name
Definition: avformat.h:510
av_bprint_is_complete
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Definition: bprint.h:218
AVERROR
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
pcm.h
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
ffio_wfourcc
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
Definition: avio_internal.h:124
av_bprint_init
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition: bprint.c:69
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
av_strcasecmp
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Definition: avstring.c:207
AV_CODEC_ID_ADPCM_G722
@ AV_CODEC_ID_ADPCM_G722
Definition: codec_id.h:395
AVCodecParameters::codec_tag
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: codec_par.h:59
AVDictionary
Definition: dict.c:34
AVProbeData::buf_size
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:454
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:313
FFOutputFormat::p
AVOutputFormat p
The public AVOutputFormat.
Definition: mux.h:65
au_codec_tags
static const AVCodecTag *const au_codec_tags[]
Definition: au.c:62
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:463
avpriv_set_pts_info
void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: avformat.c:853
AV_CODEC_ID_PCM_S16BE
@ AV_CODEC_ID_PCM_S16BE
Definition: codec_id.h:329
fail
#define fail()
Definition: checkasm.h:179
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:494
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:802
AV_DICT_DONT_STRDUP_VAL
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
Definition: dict.h:79
av_get_bits_per_sample
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
Definition: utils.c:547
AV_CODEC_ID_PCM_S8
@ AV_CODEC_ID_PCM_S8
Definition: codec_id.h:332
avassert.h
avio_rb32
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:760
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
AVCodecTag
Definition: internal.h:42
av_dict_get
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
Definition: dict.c:62
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:553
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:453
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
channels
channels
Definition: aptx.h:31
ff_raw_write_packet
int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: rawenc.c:31
AV_CODEC_ID_PCM_MULAW
@ AV_CODEC_ID_PCM_MULAW
Definition: codec_id.h:334
key
const char * key
Definition: hwcontext_opencl.c:189
AVFormatContext
Format I/O context.
Definition: avformat.h:1255
AV_CODEC_ID_PCM_ALAW
@ AV_CODEC_ID_PCM_ALAW
Definition: codec_id.h:335
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:766
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:101
AV_RN32
#define AV_RN32(p)
Definition: intreadwrite.h:362
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:451
FFOutputFormat
Definition: mux.h:61
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:180
c
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
Definition: undefined.txt:32
AVCodecParameters::sample_rate
int sample_rate
Audio only.
Definition: codec_par.h:184
AVCodecID
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: codec_id.h:49
avio_rl32
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:729
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
ff_codec_get_id
enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
Definition: utils.c:145
av_bprint_finalize
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition: bprint.c:240
state
static struct @384 state
bps
unsigned bps
Definition: movenc.c:1787
size
int size
Definition: twinvq_data.h:10344
ff_au_demuxer
const FFInputFormat ff_au_demuxer
MKBETAG
#define MKBETAG(a, b, c, d)
Definition: macros.h:56
FFInputFormat::p
AVInputFormat p
The public AVInputFormat.
Definition: demux.h:41
avio_write
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:200
avio_wb32
void avio_wb32(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:364
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:602
rawenc.h
bprint.h
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
avio_internal.h
AVCodecParameters::block_align
int block_align
Audio only.
Definition: codec_par.h:191
FF_OFMT_FLAG_MAX_ONE_OF_EACH
#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....
Definition: mux.h:50
AV_CODEC_ID_PCM_F64BE
@ AV_CODEC_ID_PCM_F64BE
Definition: codec_id.h:350
value
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
Definition: writing_filters.txt:86
AV_CODEC_ID_PCM_S32BE
@ AV_CODEC_ID_PCM_S32BE
Definition: codec_id.h:337
demux.h
ff_pcm_read_packet
int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: pcm.c:57
write_packet
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
Definition: ffmpeg_mux.c:209
tag
uint32_t tag
Definition: movenc.c:1786
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:743
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:230
ff_pcm_read_seek
int ff_pcm_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: pcm.c:73
avformat.h
av_bprintf
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition: bprint.c:99
id
enum AVCodecID id
Definition: dts2pts.c:364
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
AV_CODEC_ID_ADPCM_G726LE
@ AV_CODEC_ID_ADPCM_G726LE
Definition: codec_id.h:402
AVIO_SEEKABLE_NORMAL
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:41
ff_codec_get_tag
unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id)
Definition: utils.c:135
AU_UNKNOWN_SIZE
#define AU_UNKNOWN_SIZE
Definition: au.c:43
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:110
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:36
AVDictionaryEntry
Definition: dict.h:89
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:55
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
av_dict_set
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:88
FFInputFormat
Definition: demux.h:37
AVCodecParameters::bit_rate
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: codec_par.h:97
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
av_bprint_chars
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
Definition: bprint.c:145
BLOCK_SIZE
#define BLOCK_SIZE
Definition: adx.h:51
AVDictionaryEntry::value
char * value
Definition: dict.h:91
AVStream::start_time
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
Definition: avformat.h:792
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:346
AV_CODEC_ID_PCM_S24BE
@ AV_CODEC_ID_PCM_S24BE
Definition: codec_id.h:341
avio_feof
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition: aviobuf.c:345
mux.h