FFmpeg
smacker.c
Go to the documentation of this file.
1 /*
2  * Smacker demuxer
3  * Copyright (c) 2006 Konstantin Shishkov
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /*
23  * Based on http://wiki.multimedia.cx/index.php?title=Smacker
24  */
25 
26 #include <inttypes.h>
27 
29 #include "libavutil/intreadwrite.h"
30 #include "avformat.h"
31 #include "avio_internal.h"
32 #include "internal.h"
33 
34 #define SMACKER_PAL 0x01
35 #define SMACKER_FLAG_RING_FRAME 0x01
36 
37 enum SAudFlags {
43 };
44 
45 typedef struct SmackerContext {
46  uint32_t frames;
47  /* frame info */
48  uint32_t *frm_size;
49  uint8_t *frm_flags;
50  /* internal variables */
51  int64_t next_frame_pos;
52  int cur_frame;
54  int indexes[7];
55  int duration_size[7];
56  /* current frame for demuxing */
57  uint32_t frame_size;
58  int flags;
61  uint8_t pal[768];
62  int64_t aud_pts[7];
64 
65 /* palette used in Smacker */
66 static const uint8_t smk_pal[64] = {
67  0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
68  0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
69  0x41, 0x45, 0x49, 0x4D, 0x51, 0x55, 0x59, 0x5D,
70  0x61, 0x65, 0x69, 0x6D, 0x71, 0x75, 0x79, 0x7D,
71  0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9A, 0x9E,
72  0xA2, 0xA6, 0xAA, 0xAE, 0xB2, 0xB6, 0xBA, 0xBE,
73  0xC3, 0xC7, 0xCB, 0xCF, 0xD3, 0xD7, 0xDB, 0xDF,
74  0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF
75 };
76 
77 
78 static int smacker_probe(const AVProbeData *p)
79 {
80  if ( AV_RL32(p->buf) != MKTAG('S', 'M', 'K', '2')
81  && AV_RL32(p->buf) != MKTAG('S', 'M', 'K', '4'))
82  return 0;
83 
84  if (AV_RL32(p->buf+4) > 32768U || AV_RL32(p->buf+8) > 32768U)
85  return AVPROBE_SCORE_MAX/4;
86 
87  return AVPROBE_SCORE_MAX;
88 }
89 
91 {
92  AVIOContext *pb = s->pb;
93  SmackerContext *smk = s->priv_data;
94  AVStream *st;
95  AVCodecParameters *par;
96  uint32_t magic, width, height, flags, treesize;
97  int i, ret, pts_inc;
98  int tbase;
99 
100  /* read and check header */
101  magic = avio_rl32(pb);
102  if (magic != MKTAG('S', 'M', 'K', '2') && magic != MKTAG('S', 'M', 'K', '4'))
103  return AVERROR_INVALIDDATA;
104  width = avio_rl32(pb);
105  height = avio_rl32(pb);
106  smk->frames = avio_rl32(pb);
107  pts_inc = avio_rl32(pb);
108  if (pts_inc > INT_MAX / 100 || pts_inc == INT_MIN) {
109  av_log(s, AV_LOG_ERROR, "pts_inc %d is invalid\n", pts_inc);
110  return AVERROR_INVALIDDATA;
111  }
112 
113  flags = avio_rl32(pb);
115  smk->frames++;
116  if (smk->frames > 0xFFFFFF) {
117  av_log(s, AV_LOG_ERROR, "Too many frames: %"PRIu32"\n", smk->frames);
118  return AVERROR_INVALIDDATA;
119  }
120 
121  avio_skip(pb, 28); /* Unused audio related data */
122 
123  treesize = avio_rl32(pb);
124  if (treesize >= UINT_MAX/4) {
125  // treesize + 16 must not overflow (this check is probably redundant)
126  av_log(s, AV_LOG_ERROR, "treesize too large\n");
127  return AVERROR_INVALIDDATA;
128  }
129 
130  st = avformat_new_stream(s, NULL);
131  if (!st)
132  return AVERROR(ENOMEM);
133 
134  smk->videoindex = st->index;
135  /* Smacker uses 100000 as internal timebase */
136  if (pts_inc < 0)
137  pts_inc = -pts_inc;
138  else
139  pts_inc *= 100;
140  tbase = 100000;
141  av_reduce(&tbase, &pts_inc, tbase, pts_inc, (1UL << 31) - 1);
142  avpriv_set_pts_info(st, 33, pts_inc, tbase);
143  st->duration = smk->frames;
144 
145  /* init video codec */
146  par = st->codecpar;
147  par->width = width;
148  par->height = height;
149  par->format = AV_PIX_FMT_PAL8;
152  par->codec_tag = magic;
153 
154  if ((ret = ff_alloc_extradata(par, treesize + 16)) < 0) {
156  "Cannot allocate %"PRIu32" bytes of extradata\n",
157  treesize + 16);
158  return ret;
159  }
160  if ((ret = ffio_read_size(pb, par->extradata, 16)) < 0)
161  return ret;
162 
163  /* handle possible audio streams */
164  for (i = 0; i < 7; i++) {
165  uint32_t rate = avio_rl24(pb);
166  uint8_t aflag = avio_r8(pb);
167 
168  smk->indexes[i] = -1;
169 
170  if (rate) {
172  AVCodecParameters *par;
173  if (!ast)
174  return AVERROR(ENOMEM);
175 
176  smk->indexes[i] = ast->index;
177  par = ast->codecpar;
179  if (aflag & SMK_AUD_BINKAUD) {
181  } else if (aflag & SMK_AUD_USEDCT) {
183  } else if (aflag & SMK_AUD_PACKED) {
185  par->codec_tag = MKTAG('S', 'M', 'K', 'A');
186  } else {
188  }
189  if (aflag & SMK_AUD_STEREO) {
190  par->channels = 2;
192  } else {
193  par->channels = 1;
195  }
196  par->sample_rate = rate;
197  par->bits_per_coded_sample = (aflag & SMK_AUD_16BITS) ? 16 : 8;
198  if (par->bits_per_coded_sample == 16 &&
201  else
202  smk->duration_size[i] = 4;
203  avpriv_set_pts_info(ast, 64, 1, par->sample_rate * par->channels
204  * par->bits_per_coded_sample / 8);
205  }
206  }
207 
208  avio_rl32(pb); /* padding */
209 
210  /* setup data */
211  st->priv_data = av_malloc_array(smk->frames, sizeof(*smk->frm_size) +
212  sizeof(*smk->frm_flags));
213  if (!st->priv_data)
214  return AVERROR(ENOMEM);
215  smk->frm_size = st->priv_data;
216  smk->frm_flags = (void*)(smk->frm_size + smk->frames);
217 
218  /* read frame info */
219  for (i = 0; i < smk->frames; i++) {
220  smk->frm_size[i] = avio_rl32(pb);
221  }
222  if ((ret = ffio_read_size(pb, smk->frm_flags, smk->frames)) < 0 ||
223  /* load trees to extradata, they will be unpacked by decoder */
224  (ret = ffio_read_size(pb, par->extradata + 16,
225  par->extradata_size - 16)) < 0) {
226  return ret;
227  }
228 
229  return 0;
230 }
231 
233 {
234  SmackerContext *smk = s->priv_data;
235  int flags;
236  int ret;
237 
238  if (avio_feof(s->pb) || smk->cur_frame >= smk->frames)
239  return AVERROR_EOF;
240 
241  /* if we demuxed all streams, pass another frame */
242  if (!smk->next_audio_index) {
243  smk->frame_size = smk->frm_size[smk->cur_frame] & (~3);
244  smk->next_frame_pos = avio_tell(s->pb) + smk->frame_size;
245  flags = smk->frm_flags[smk->cur_frame];
246  smk->flags = flags >> 1;
247  /* handle palette change event */
248  if (flags & SMACKER_PAL) {
249  int size, sz, t, off, j, pos;
250  uint8_t *pal = smk->pal;
251  uint8_t oldpal[768];
252 
253  memcpy(oldpal, pal, 768);
254  size = avio_r8(s->pb);
255  size = size * 4;
256  if (size > smk->frame_size) {
258  goto next_frame;
259  }
260  smk->frame_size -= size--;
261  sz = 0;
262  pos = avio_tell(s->pb) + size;
263  while (sz < 256) {
264  t = avio_r8(s->pb);
265  if (t & 0x80) { /* skip palette entries */
266  sz += (t & 0x7F) + 1;
267  pal += ((t & 0x7F) + 1) * 3;
268  } else if (t & 0x40) { /* copy with offset */
269  off = avio_r8(s->pb);
270  j = (t & 0x3F) + 1;
271  if (off + j > 0x100) {
273  "Invalid palette update, offset=%d length=%d extends beyond palette size\n",
274  off, j);
276  goto next_frame;
277  }
278  off *= 3;
279  while (j-- && sz < 256) {
280  *pal++ = oldpal[off + 0];
281  *pal++ = oldpal[off + 1];
282  *pal++ = oldpal[off + 2];
283  sz++;
284  off += 3;
285  }
286  } else { /* new entries */
287  *pal++ = smk_pal[t];
288  *pal++ = smk_pal[avio_r8(s->pb) & 0x3F];
289  *pal++ = smk_pal[avio_r8(s->pb) & 0x3F];
290  sz++;
291  }
292  }
293  avio_seek(s->pb, pos, 0);
294  smk->new_palette = 1;
295  }
296  }
297 
298  for (int i = smk->next_audio_index; i < 7; i++) {
299  if (smk->flags & (1 << i)) {
300  uint32_t size;
301 
302  size = avio_rl32(s->pb);
303  if ((int)size < 4 + smk->duration_size[i] || size > smk->frame_size) {
304  av_log(s, AV_LOG_ERROR, "Invalid audio part size\n");
306  goto next_frame;
307  }
308  smk->frame_size -= size;
309  size -= 4;
310 
311  if (smk->indexes[i] < 0 ||
312  s->streams[smk->indexes[i]]->discard >= AVDISCARD_ALL) {
313  smk->aud_pts[i] += smk->duration_size[i] ? avio_rl32(s->pb)
314  : size;
315  avio_skip(s->pb, size - smk->duration_size[i]);
316  continue;
317  }
318  if ((ret = av_get_packet(s->pb, pkt, size)) != size) {
319  ret = ret < 0 ? ret : AVERROR_INVALIDDATA;
320  goto next_frame;
321  }
322  pkt->stream_index = smk->indexes[i];
323  pkt->pts = smk->aud_pts[i];
324  pkt->duration = smk->duration_size[i] ? AV_RL32(pkt->data)
325  : size;
326  smk->aud_pts[i] += pkt->duration;
327  smk->next_audio_index = i + 1;
328  return 0;
329  }
330  }
331 
332  if (s->streams[smk->videoindex]->discard >= AVDISCARD_ALL) {
333  ret = FFERROR_REDO;
334  goto next_frame;
335  }
336  if (smk->frame_size >= INT_MAX/2) {
338  goto next_frame;
339  }
340  if ((ret = av_new_packet(pkt, smk->frame_size + 769)) < 0)
341  goto next_frame;
342  flags = smk->new_palette;
343  if (smk->frm_size[smk->cur_frame] & 1)
344  flags |= 2;
345  pkt->data[0] = flags;
346  memcpy(pkt->data + 1, smk->pal, 768);
347  ret = ffio_read_size(s->pb, pkt->data + 769, smk->frame_size);
348  if (ret < 0)
349  goto next_frame;
350  pkt->stream_index = smk->videoindex;
351  pkt->pts = smk->cur_frame;
352  smk->next_audio_index = 0;
353  smk->new_palette = 0;
354  smk->cur_frame++;
355 
356  return 0;
357 next_frame:
358  avio_seek(s->pb, smk->next_frame_pos, SEEK_SET);
359  smk->next_audio_index = 0;
360  smk->cur_frame++;
361  return ret;
362 }
363 
364 static int smacker_read_seek(AVFormatContext *s, int stream_index,
365  int64_t timestamp, int flags)
366 {
367  SmackerContext *smk = s->priv_data;
368  int64_t ret;
369 
370  /* only rewinding to start is supported */
371  if (timestamp != 0) {
373  "Random seeks are not supported (can only seek to start).\n");
374  return AVERROR(EINVAL);
375  }
376 
377  if ((ret = avio_seek(s->pb, ffformatcontext(s)->data_offset, SEEK_SET)) < 0)
378  return ret;
379 
380  smk->cur_frame = 0;
381  smk->next_audio_index = 0;
382  smk->new_palette = 0;
383  memset(smk->pal, 0, sizeof(smk->pal));
384  memset(smk->aud_pts, 0, sizeof(smk->aud_pts));
385 
386  return 0;
387 }
388 
390  .name = "smk",
391  .long_name = NULL_IF_CONFIG_SMALL("Smacker"),
392  .priv_data_size = sizeof(SmackerContext),
397 };
AV_CODEC_ID_PCM_S16LE
@ AV_CODEC_ID_PCM_S16LE
Definition: codec_id.h:314
SMK_AUD_BINKAUD
@ SMK_AUD_BINKAUD
Definition: smacker.c:41
AVCodecParameters::extradata
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: codec_par.h:74
SMACKER_PAL
#define SMACKER_PAL
Definition: smacker.c:34
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
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:768
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:56
FFERROR_REDO
#define FFERROR_REDO
Returned by demuxers to indicate that data was consumed but discarded (ignored streams or junk data).
Definition: internal.h:912
SmackerContext::videoindex
int videoindex
Definition: smacker.c:53
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:52
ffformatcontext
static av_always_inline FFFormatContext * ffformatcontext(AVFormatContext *s)
Definition: internal.h:189
AVStream::priv_data
void * priv_data
Definition: avformat.h:951
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:90
AVPacket::data
uint8_t * data
Definition: packet.h:373
SMK_AUD_PACKED
@ SMK_AUD_PACKED
Definition: smacker.c:38
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:391
AVCodecParameters::codec_tag
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: codec_par.h:64
SMK_AUD_STEREO
@ SMK_AUD_STEREO
Definition: smacker.c:40
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:459
AVCodecParameters::channels
int channels
Audio only.
Definition: codec_par.h:166
U
#define U(x)
Definition: vp56_arith.h:37
SmackerContext::frm_flags
uint8_t * frm_flags
Definition: smacker.c:49
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:149
SmackerContext::aud_pts
int64_t aud_pts[7]
Definition: smacker.c:62
AV_CODEC_ID_SMACKAUDIO
@ AV_CODEC_ID_SMACKAUDIO
Definition: codec_id.h:446
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:504
smacker_probe
static int smacker_probe(const AVProbeData *p)
Definition: smacker.c:78
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:985
av_reduce
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Definition: rational.c:35
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:91
pkt
AVPacket * pkt
Definition: movenc.c:59
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AVInputFormat
Definition: avformat.h:650
SmackerContext::next_frame_pos
int64_t next_frame_pos
Definition: smacker.c:51
width
#define width
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:257
SmackerContext::new_palette
int new_palette
Definition: smacker.c:60
av_new_packet
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: avpacket.c:99
SMK_AUD_16BITS
@ SMK_AUD_16BITS
Definition: smacker.c:39
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:655
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:449
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:126
AV_CODEC_ID_BINKAUDIO_DCT
@ AV_CODEC_ID_BINKAUDIO_DCT
Definition: codec_id.h:471
AVDISCARD_ALL
@ AVDISCARD_ALL
discard all
Definition: defs.h:54
AVFormatContext
Format I/O context.
Definition: avformat.h:1200
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:1095
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
NULL
#define NULL
Definition: coverity.c:32
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:447
SmackerContext
Definition: smacker.c:45
AVCodecParameters::sample_rate
int sample_rate
Audio only.
Definition: codec_par.h:170
SMACKER_FLAG_RING_FRAME
#define SMACKER_FLAG_RING_FRAME
Definition: smacker.c:35
SmackerContext::indexes
int indexes[7]
Definition: smacker.c:54
AVCodecParameters::extradata_size
int extradata_size
Size of the extradata content in bytes.
Definition: codec_par.h:78
avio_rl32
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:759
SmackerContext::pal
uint8_t pal[768]
Definition: smacker.c:61
smacker_read_packet
static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: smacker.c:232
AVIOContext
Bytestream IO Context.
Definition: avio.h:161
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:117
SmackerContext::duration_size
int duration_size[7]
Definition: smacker.c:55
SmackerContext::frame_size
uint32_t frame_size
Definition: smacker.c:57
size
int size
Definition: twinvq_data.h:10344
smk_pal
static const uint8_t smk_pal[64]
Definition: smacker.c:66
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:632
height
#define height
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:366
avio_rl24
unsigned int avio_rl24(AVIOContext *s)
Definition: aviobuf.c:751
avio_internal.h
AVCodecParameters::height
int height
Definition: codec_par.h:127
av_malloc_array
#define av_malloc_array(a, b)
Definition: tableprint_vlc.h:32
SMK_AUD_USEDCT
@ SMK_AUD_USEDCT
Definition: smacker.c:42
smacker_read_header
static int smacker_read_header(AVFormatContext *s)
Definition: smacker.c:90
av_get_packet
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.
Definition: utils.c:197
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
AV_CODEC_ID_SMACKVIDEO
@ AV_CODEC_ID_SMACKVIDEO
Definition: codec_id.h:133
ret
ret
Definition: filter_design.txt:187
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
AVStream
Stream structure.
Definition: avformat.h:935
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:260
pos
unsigned int pos
Definition: spdifenc.c:412
avformat.h
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
AVStream::index
int index
stream index in AVFormatContext
Definition: avformat.h:943
channel_layout.h
SmackerContext::frames
uint32_t frames
Definition: smacker.c:46
smacker_read_seek
static int smacker_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: smacker.c:364
SmackerContext::frm_size
uint32_t * frm_size
Definition: smacker.c:48
SmackerContext::next_audio_index
int next_audio_index
Definition: smacker.c:59
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: utils.c:1196
AVPacket::stream_index
int stream_index
Definition: packet.h:375
ff_smacker_demuxer
const AVInputFormat ff_smacker_demuxer
Definition: smacker.c:389
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:347
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:102
AV_CODEC_ID_PCM_U8
@ AV_CODEC_ID_PCM_U8
Definition: codec_id.h:319
SAudFlags
SAudFlags
Definition: smacker.c:37
AVCodecParameters::format
int format
Definition: codec_par.h:84
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:60
AVPacket
This structure stores compressed data.
Definition: packet.h:350
AVCodecParameters::channel_layout
uint64_t channel_layout
Audio only.
Definition: codec_par.h:162
SmackerContext::flags
int flags
Definition: smacker.c:58
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
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
ffio_read_size
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:691
AV_CODEC_ID_BINKAUDIO_RDFT
@ AV_CODEC_ID_BINKAUDIO_RDFT
Definition: codec_id.h:470
SmackerContext::cur_frame
int cur_frame
Definition: smacker.c:52
ff_alloc_extradata
int ff_alloc_extradata(AVCodecParameters *par, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0.
Definition: utils.c:451
avio_feof
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition: aviobuf.c:375