libavformat/iff.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 Jaikrishnan Menon <realityman@gmx.net>
3  * Copyright (c) 2010 Peter Ross <pross@xvid.org>
4  * Copyright (c) 2010 Sebastian Vater <cdgs.basty@googlemail.com>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * IFF file demuxer
26  * by Jaikrishnan Menon
27  * for more information on the .iff file format, visit:
28  * http://wiki.multimedia.cx/index.php?title=IFF
29  */
30 
31 #include "libavutil/avassert.h"
33 #include "libavutil/intreadwrite.h"
34 #include "libavutil/dict.h"
35 #include "libavcodec/bytestream.h"
36 #include "avformat.h"
37 #include "internal.h"
38 
39 #define ID_8SVX MKTAG('8','S','V','X')
40 #define ID_16SV MKTAG('1','6','S','V')
41 #define ID_MAUD MKTAG('M','A','U','D')
42 #define ID_MHDR MKTAG('M','H','D','R')
43 #define ID_MDAT MKTAG('M','D','A','T')
44 #define ID_VHDR MKTAG('V','H','D','R')
45 #define ID_ATAK MKTAG('A','T','A','K')
46 #define ID_RLSE MKTAG('R','L','S','E')
47 #define ID_CHAN MKTAG('C','H','A','N')
48 #define ID_PBM MKTAG('P','B','M',' ')
49 #define ID_ILBM MKTAG('I','L','B','M')
50 #define ID_BMHD MKTAG('B','M','H','D')
51 #define ID_DGBL MKTAG('D','G','B','L')
52 #define ID_CAMG MKTAG('C','A','M','G')
53 #define ID_CMAP MKTAG('C','M','A','P')
54 #define ID_ACBM MKTAG('A','C','B','M')
55 #define ID_DEEP MKTAG('D','E','E','P')
56 #define ID_RGB8 MKTAG('R','G','B','8')
57 #define ID_RGBN MKTAG('R','G','B','N')
58 
59 #define ID_FORM MKTAG('F','O','R','M')
60 #define ID_ANNO MKTAG('A','N','N','O')
61 #define ID_AUTH MKTAG('A','U','T','H')
62 #define ID_CHRS MKTAG('C','H','R','S')
63 #define ID_COPYRIGHT MKTAG('(','c',')',' ')
64 #define ID_CSET MKTAG('C','S','E','T')
65 #define ID_FVER MKTAG('F','V','E','R')
66 #define ID_NAME MKTAG('N','A','M','E')
67 #define ID_TEXT MKTAG('T','E','X','T')
68 #define ID_ABIT MKTAG('A','B','I','T')
69 #define ID_BODY MKTAG('B','O','D','Y')
70 #define ID_DBOD MKTAG('D','B','O','D')
71 #define ID_DPEL MKTAG('D','P','E','L')
72 #define ID_DLOC MKTAG('D','L','O','C')
73 #define ID_TVDC MKTAG('T','V','D','C')
74 
75 #define LEFT 2
76 #define RIGHT 4
77 #define STEREO 6
78 
79 /**
80  * This number of bytes if added at the beginning of each AVPacket
81  * which contain additional information about video properties
82  * which has to be shared between demuxer and decoder.
83  * This number may change between frames, e.g. the demuxer might
84  * set it to smallest possible size of 2 to indicate that there's
85  * no extradata changing in this frame.
86  */
87 #define IFF_EXTRA_VIDEO_SIZE 41
88 
89 typedef enum {
94 
95 typedef struct {
96  int64_t body_pos;
97  int64_t body_end;
98  uint32_t body_size;
100  unsigned maud_bits;
102  unsigned bitmap_compression; ///< delta compression method used
103  unsigned bpp; ///< bits per plane to decode (differs from bits_per_coded_sample if HAM)
104  unsigned ham; ///< 0 if non-HAM or number of hold bits (6 for bpp > 6, 4 otherwise)
105  unsigned flags; ///< 1 for EHB, 0 is no extra half darkening
106  unsigned transparency; ///< transparency color index in palette
107  unsigned masking; ///< masking method used
108  uint8_t tvdc[32]; ///< TVDC lookup table
110 
111 /* Metadata string read */
113  const char *const tag,
114  const unsigned data_size)
115 {
116  uint8_t *buf = ((data_size + 1) == 0) ? NULL : av_malloc(data_size + 1);
117 
118  if (!buf)
119  return AVERROR(ENOMEM);
120 
121  if (avio_read(s->pb, buf, data_size) < 0) {
122  av_free(buf);
123  return AVERROR(EIO);
124  }
125  buf[data_size] = 0;
127  return 0;
128 }
129 
130 static int iff_probe(AVProbeData *p)
131 {
132  const uint8_t *d = p->buf;
133 
134  if ( AV_RL32(d) == ID_FORM &&
135  (AV_RL32(d+8) == ID_8SVX ||
136  AV_RL32(d+8) == ID_16SV ||
137  AV_RL32(d+8) == ID_MAUD ||
138  AV_RL32(d+8) == ID_PBM ||
139  AV_RL32(d+8) == ID_ACBM ||
140  AV_RL32(d+8) == ID_DEEP ||
141  AV_RL32(d+8) == ID_ILBM ||
142  AV_RL32(d+8) == ID_RGB8 ||
143  AV_RL32(d+8) == ID_RGBN) )
144  return AVPROBE_SCORE_MAX;
145  return 0;
146 }
147 
148 static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
149 static const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
150 static const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
151 static const uint8_t deep_argb[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8};
152 static const uint8_t deep_abgr[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8};
153 
155 {
156  IffDemuxContext *iff = s->priv_data;
157  AVIOContext *pb = s->pb;
158  AVStream *st;
159  uint8_t *buf;
160  uint32_t chunk_id, data_size;
161  uint32_t screenmode = 0, num, den;
162  unsigned transparency = 0;
163  unsigned masking = 0; // no mask
164  uint8_t fmt[16];
165  int fmt_size;
166 
167  st = avformat_new_stream(s, NULL);
168  if (!st)
169  return AVERROR(ENOMEM);
170 
171  st->codec->channels = 1;
173  avio_skip(pb, 8);
174  // codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content
175  st->codec->codec_tag = avio_rl32(pb);
176  iff->bitmap_compression = -1;
177  iff->svx8_compression = -1;
178  iff->maud_bits = -1;
179  iff->maud_compression = -1;
180 
181  while(!url_feof(pb)) {
182  uint64_t orig_pos;
183  int res;
184  const char *metadata_tag = NULL;
185  chunk_id = avio_rl32(pb);
186  data_size = avio_rb32(pb);
187  orig_pos = avio_tell(pb);
188 
189  switch(chunk_id) {
190  case ID_VHDR:
192 
193  if (data_size < 14)
194  return AVERROR_INVALIDDATA;
195  avio_skip(pb, 12);
196  st->codec->sample_rate = avio_rb16(pb);
197  if (data_size >= 16) {
198  avio_skip(pb, 1);
199  iff->svx8_compression = avio_r8(pb);
200  }
201  break;
202 
203  case ID_MHDR:
205 
206  if (data_size < 32)
207  return AVERROR_INVALIDDATA;
208  avio_skip(pb, 4);
209  iff->maud_bits = avio_rb16(pb);
210  avio_skip(pb, 2);
211  num = avio_rb32(pb);
212  den = avio_rb16(pb);
213  if (!den)
214  return AVERROR_INVALIDDATA;
215  avio_skip(pb, 2);
216  st->codec->sample_rate = num / den;
217  st->codec->channels = avio_rb16(pb);
218  iff->maud_compression = avio_rb16(pb);
219  if (st->codec->channels == 1)
221  else if (st->codec->channels == 2)
223  break;
224 
225  case ID_ABIT:
226  case ID_BODY:
227  case ID_DBOD:
228  case ID_MDAT:
229  iff->body_pos = avio_tell(pb);
230  iff->body_end = iff->body_pos + data_size;
231  iff->body_size = data_size;
232  break;
233 
234  case ID_CHAN:
235  if (data_size < 4)
236  return AVERROR_INVALIDDATA;
237  if (avio_rb32(pb) < 6) {
238  st->codec->channels = 1;
240  } else {
241  st->codec->channels = 2;
243  }
244  break;
245 
246  case ID_CAMG:
247  if (data_size < 4)
248  return AVERROR_INVALIDDATA;
249  screenmode = avio_rb32(pb);
250  break;
251 
252  case ID_CMAP:
253  if (data_size < 3 || data_size > 768 || data_size % 3) {
254  av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n",
255  data_size);
256  return AVERROR_INVALIDDATA;
257  }
258  st->codec->extradata_size = data_size + IFF_EXTRA_VIDEO_SIZE;
259  st->codec->extradata = av_malloc(data_size + IFF_EXTRA_VIDEO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
260  if (!st->codec->extradata)
261  return AVERROR(ENOMEM);
262  if (avio_read(pb, st->codec->extradata + IFF_EXTRA_VIDEO_SIZE, data_size) < 0)
263  return AVERROR(EIO);
264  break;
265 
266  case ID_BMHD:
268  if (data_size <= 8)
269  return AVERROR_INVALIDDATA;
270  st->codec->width = avio_rb16(pb);
271  st->codec->height = avio_rb16(pb);
272  avio_skip(pb, 4); // x, y offset
274  if (data_size >= 10)
275  masking = avio_r8(pb);
276  if (data_size >= 11)
277  iff->bitmap_compression = avio_r8(pb);
278  if (data_size >= 14) {
279  avio_skip(pb, 1); // padding
280  transparency = avio_rb16(pb);
281  }
282  if (data_size >= 16) {
283  st->sample_aspect_ratio.num = avio_r8(pb);
284  st->sample_aspect_ratio.den = avio_r8(pb);
285  }
286  break;
287 
288  case ID_DPEL:
289  if (data_size < 4 || (data_size & 3))
290  return AVERROR_INVALIDDATA;
291  if ((fmt_size = avio_read(pb, fmt, sizeof(fmt))) < 0)
292  return fmt_size;
293  if (fmt_size == sizeof(deep_rgb24) && !memcmp(fmt, deep_rgb24, sizeof(deep_rgb24)))
295  else if (fmt_size == sizeof(deep_rgba) && !memcmp(fmt, deep_rgba, sizeof(deep_rgba)))
297  else if (fmt_size == sizeof(deep_bgra) && !memcmp(fmt, deep_bgra, sizeof(deep_bgra)))
299  else if (fmt_size == sizeof(deep_argb) && !memcmp(fmt, deep_argb, sizeof(deep_argb)))
301  else if (fmt_size == sizeof(deep_abgr) && !memcmp(fmt, deep_abgr, sizeof(deep_abgr)))
303  else {
304  avpriv_request_sample(s, "color format %.16s", fmt);
305  return AVERROR_PATCHWELCOME;
306  }
307  break;
308 
309  case ID_DGBL:
311  if (data_size < 8)
312  return AVERROR_INVALIDDATA;
313  st->codec->width = avio_rb16(pb);
314  st->codec->height = avio_rb16(pb);
315  iff->bitmap_compression = avio_rb16(pb);
316  st->sample_aspect_ratio.num = avio_r8(pb);
317  st->sample_aspect_ratio.den = avio_r8(pb);
318  st->codec->bits_per_coded_sample = 24;
319  break;
320 
321  case ID_DLOC:
322  if (data_size < 4)
323  return AVERROR_INVALIDDATA;
324  st->codec->width = avio_rb16(pb);
325  st->codec->height = avio_rb16(pb);
326  break;
327 
328  case ID_TVDC:
329  if (data_size < sizeof(iff->tvdc))
330  return AVERROR_INVALIDDATA;
331  res = avio_read(pb, iff->tvdc, sizeof(iff->tvdc));
332  if (res < 0)
333  return res;
334  break;
335 
336  case ID_ANNO:
337  case ID_TEXT: metadata_tag = "comment"; break;
338  case ID_AUTH: metadata_tag = "artist"; break;
339  case ID_COPYRIGHT: metadata_tag = "copyright"; break;
340  case ID_NAME: metadata_tag = "title"; break;
341  }
342 
343  if (metadata_tag) {
344  if ((res = get_metadata(s, metadata_tag, data_size)) < 0) {
345  av_log(s, AV_LOG_ERROR, "cannot allocate metadata tag %s!\n", metadata_tag);
346  return res;
347  }
348  }
349  avio_skip(pb, data_size - (avio_tell(pb) - orig_pos) + (data_size & 1));
350  }
351 
352  avio_seek(pb, iff->body_pos, SEEK_SET);
353 
354  switch(st->codec->codec_type) {
355  case AVMEDIA_TYPE_AUDIO:
356  avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
357 
358  if (st->codec->codec_tag == ID_16SV)
360  else if (st->codec->codec_tag == ID_MAUD) {
361  if (iff->maud_bits == 8 && !iff->maud_compression) {
363  } else if (iff->maud_bits == 16 && !iff->maud_compression) {
365  } else if (iff->maud_bits == 8 && iff->maud_compression == 2) {
367  } else if (iff->maud_bits == 8 && iff->maud_compression == 3) {
369  } else {
370  avpriv_request_sample(s, "compression %d and bit depth %d", iff->maud_compression, iff->maud_bits);
371  return AVERROR_PATCHWELCOME;
372  }
373 
376 
377  st->codec->block_align =
378  st->codec->bits_per_coded_sample * st->codec->channels / 8;
379  } else {
380  switch (iff->svx8_compression) {
381  case COMP_NONE:
383  break;
384  case COMP_FIB:
386  break;
387  case COMP_EXP:
389  break;
390  default:
391  av_log(s, AV_LOG_ERROR,
392  "Unknown SVX8 compression method '%d'\n", iff->svx8_compression);
393  return -1;
394  }
395  }
396 
400  break;
401 
402  case AVMEDIA_TYPE_VIDEO:
403  iff->bpp = st->codec->bits_per_coded_sample;
404  if ((screenmode & 0x800 /* Hold And Modify */) && iff->bpp <= 8) {
405  iff->ham = iff->bpp > 6 ? 6 : 4;
406  st->codec->bits_per_coded_sample = 24;
407  }
408  iff->flags = (screenmode & 0x80 /* Extra HalfBrite */) && iff->bpp <= 8;
409  iff->masking = masking;
410  iff->transparency = transparency;
411 
412  if (!st->codec->extradata) {
415  if (!st->codec->extradata)
416  return AVERROR(ENOMEM);
417  }
419  buf = st->codec->extradata;
422  bytestream_put_byte(&buf, iff->bpp);
423  bytestream_put_byte(&buf, iff->ham);
424  bytestream_put_byte(&buf, iff->flags);
425  bytestream_put_be16(&buf, iff->transparency);
426  bytestream_put_byte(&buf, iff->masking);
427  bytestream_put_buffer(&buf, iff->tvdc, sizeof(iff->tvdc));
429  break;
430  default:
431  return -1;
432  }
433 
434  return 0;
435 }
436 
438  AVPacket *pkt)
439 {
440  IffDemuxContext *iff = s->priv_data;
441  AVIOContext *pb = s->pb;
442  AVStream *st = s->streams[0];
443  int ret;
444  int64_t pos = avio_tell(pb);
445 
446  if (pos >= iff->body_end)
447  return AVERROR_EOF;
448 
449  if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
450  if (st->codec->codec_tag == ID_MAUD) {
451  ret = av_get_packet(pb, pkt, FFMIN(iff->body_end - pos, 1024 * st->codec->block_align));
452  } else {
453  ret = av_get_packet(pb, pkt, iff->body_size);
454  }
455  } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
456  uint8_t *buf;
457 
458  if (av_new_packet(pkt, iff->body_size + 2) < 0) {
459  return AVERROR(ENOMEM);
460  }
461 
462  buf = pkt->data;
463  bytestream_put_be16(&buf, 2);
464  ret = avio_read(pb, buf, iff->body_size);
465  } else {
466  av_assert0(0);
467  }
468 
469  if (pos == iff->body_pos)
470  pkt->flags |= AV_PKT_FLAG_KEY;
471  if (ret < 0)
472  return ret;
473  pkt->stream_index = 0;
474  return ret;
475 }
476 
478  .name = "iff",
479  .long_name = NULL_IF_CONFIG_SMALL("IFF (Interchange File Format)"),
480  .priv_data_size = sizeof(IffDemuxContext),
485 };
static const uint8_t deep_abgr[]
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:73
unsigned transparency
transparency color index in palette
#define ID_CAMG
const char * s
Definition: avisynth_c.h:668
Bytestream IO Context.
Definition: avio.h:68
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
unsigned ham
0 if non-HAM or number of hold bits (6 for bpp > 6, 4 otherwise)
#define ID_RGB8
#define ID_ACBM
const char * fmt
Definition: avisynth_c.h:669
#define ID_PBM
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
Definition: avformat.h:709
int num
numerator
Definition: rational.h:44
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:199
unsigned maud_compression
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:256
#define ID_8SVX
#define AV_CH_LAYOUT_STEREO
unsigned int avio_rb16(AVIOContext *s)
Definition: aviobuf.c:595
svx8_compression_type svx8_compression
#define IFF_EXTRA_VIDEO_SIZE
This number of bytes if added at the beginning of each AVPacket which contain additional information ...
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
#define ID_16SV
set threshold d
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
Format I/O context.
Definition: avformat.h:944
#define ID_MHDR
uint8_t tvdc[32]
TVDC lookup table.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
Public dictionary API.
#define ID_ANNO
#define ID_MAUD
#define ID_NAME
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:610
static int iff_probe(AVProbeData *p)
static AVPacket pkt
Definition: demuxing.c:56
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
Definition: avformat.h:992
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:98
#define ID_DBOD
uint8_t * data
uint32_t tag
Definition: movenc.c:894
#define AVERROR_EOF
End of file.
Definition: error.h:55
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
static av_always_inline void bytestream_put_byte(uint8_t **b, const unsigned int value)
Definition: bytestream.h:92
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:248
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define ID_CHAN
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:478
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int iff_read_header(AVFormatContext *s)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: avpacket.c:73
#define ID_TEXT
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVDictionary * metadata
Definition: avformat.h:1092
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:183
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:579
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:99
simple assert() macros that are a bit more flexible than ISO C assert().
#define ID_FORM
void av_log(void *avcl, int level, const char *fmt,...)
Send the specified message to the log if the level is less than or equal to the current av_log_level...
Definition: log.c:246
#define ID_ILBM
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:96
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:97
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:469
AVCodecContext * codec
Codec context associated with this stream.
Definition: avformat.h:662
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:336
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
unsigned flags
1 for EHB, 0 is no extra half darkening
#define ID_VHDR
#define ID_TVDC
int bit_rate
the average bitrate
audio channel layout utility functions
#define ID_ABIT
#define ID_BODY
#define FFMIN(a, b)
Definition: common.h:58
AVInputFormat ff_iff_demuxer
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that&#39;s been allocated with av_malloc() and chilren.
Definition: dict.h:72
static int read_probe(AVProbeData *pd)
ret
Definition: avfilter.c:821
int width
picture width / height.
#define ID_AUTH
#define AV_RL32
int url_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
Definition: aviobuf.c:280
static int iff_read_packet(AVFormatContext *s, AVPacket *pkt)
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
Stream structure.
Definition: avformat.h:643
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:62
NULL
Definition: eval.c:55
svx8_compression_type
enum AVMediaType codec_type
unsigned bpp
bits per plane to decode (differs from bits_per_coded_sample if HAM)
enum AVCodecID codec_id
int sample_rate
samples per second
AVIOContext * pb
I/O context.
Definition: avformat.h:977
#define ID_RGBN
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> (&#39;D&#39;<<24) + (&#39;C&#39;<<16) + (&#39;B&#39;<<8) + &#39;A&#39;).
static av_always_inline void bytestream_put_be16(uint8_t **b, const unsigned int value)
Definition: bytestream.h:91
void * buf
Definition: avisynth_c.h:594
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
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:62
#define ID_MDAT
#define ID_DEEP
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:353
This structure contains the data a format has to probe a file.
Definition: avformat.h:334
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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.Buffer references ownership and permissions
#define ID_DGBL
#define ID_DLOC
static int flags
Definition: cpu.c:23
static const uint8_t deep_rgba[]
#define AVPROBE_SCORE_MAX
maximum score, half of that is used for file-extension-based detection
Definition: avformat.h:340
Main libavformat public API header.
unsigned bitmap_compression
delta compression method used
static const uint8_t deep_bgra[]
#define ID_CMAP
int den
denominator
Definition: rational.h:45
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
Definition: bytestream.h:337
static const uint8_t deep_rgb24[]
int channels
number of audio channels
void * priv_data
Format private data.
Definition: avformat.h:964
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:461
#define ID_DPEL
static int get_metadata(AVFormatContext *s, const char *const tag, const unsigned data_size)
static const uint8_t deep_argb[]
#define ID_COPYRIGHT
#define AV_CH_LAYOUT_MONO
#define ID_BMHD
This structure stores compressed data.
unsigned masking
masking method used
void avpriv_request_sample(void *avc, const char *msg,...)
Log a generic warning message about a missing feature.
Definition: log.c:297