FFmpeg
bintext.c
Go to the documentation of this file.
1 /*
2  * Binary text demuxer
3  * eXtended BINary text (XBIN) demuxer
4  * Artworx Data Format demuxer
5  * iCEDraw File demuxer
6  * Copyright (c) 2010 Peter Ross <pross@xvid.org>
7  *
8  * This file is part of FFmpeg.
9  *
10  * FFmpeg is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * FFmpeg is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with FFmpeg; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  */
24 
25 /**
26  * @file
27  * Binary text demuxer
28  * eXtended BINary text (XBIN) demuxer
29  * Artworx Data Format demuxer
30  * iCEDraw File demuxer
31  */
32 
33 #include "config_components.h"
34 
35 #include "libavutil/intreadwrite.h"
36 #include "libavutil/opt.h"
37 #include "libavutil/parseutils.h"
38 #include "avformat.h"
39 #include "internal.h"
40 #include "sauce.h"
41 #include "libavcodec/bintext.h"
42 
43 typedef struct {
44  const AVClass *class;
45  int chars_per_frame; /**< characters to send decoder per frame;
46  set by private options as characters per second, and then
47  converted to characters per frame at runtime */
48  int width, height; /**< video size (WxH pixels) (private option) */
49  AVRational framerate; /**< frames per second (private option) */
50  uint64_t fsize; /**< file size less metadata buffer */
52 
54 {
55  BinDemuxContext *bin = s->priv_data;
57  if (!st)
58  return NULL;
59  st->codecpar->codec_tag = 0;
61 
62  if (!bin->width) {
63  st->codecpar->width = (80<<3);
64  st->codecpar->height = (25<<4);
65  }
66 
67  avpriv_set_pts_info(st, 60, bin->framerate.den, bin->framerate.num);
68 
69  /* simulate tty display speed */
70  bin->chars_per_frame = av_clip(av_q2d(st->time_base) * bin->chars_per_frame, 1, INT_MAX);
71 
72  return st;
73 }
74 
75 #if CONFIG_BINTEXT_DEMUXER | CONFIG_ADF_DEMUXER | CONFIG_IDF_DEMUXER
76 /**
77  * Given filesize and width, calculate height (assume font_height of 16)
78  */
79 static void calculate_height(AVCodecParameters *par, uint64_t fsize)
80 {
81  par->height = (fsize / ((par->width>>3)*2)) << 4;
82 }
83 #endif
84 
85 #if CONFIG_BINTEXT_DEMUXER
86 static const uint8_t next_magic[]={
87  0x1A, 0x1B, '[', '0', ';', '3', '0', ';', '4', '0', 'm', 'N', 'E', 'X', 'T', 0x00
88 };
89 
90 static int next_tag_read(AVFormatContext *avctx, uint64_t *fsize)
91 {
92  AVIOContext *pb = avctx->pb;
93  char buf[36];
94  int len;
95  uint64_t start_pos = avio_size(pb) - 256;
96 
97  avio_seek(pb, start_pos, SEEK_SET);
98  if (avio_read(pb, buf, sizeof(next_magic)) != sizeof(next_magic))
99  return -1;
100  if (memcmp(buf, next_magic, sizeof(next_magic)))
101  return -1;
102  if (avio_r8(pb) != 0x01)
103  return -1;
104 
105  *fsize -= 256;
106 
107 #define GET_EFI2_META(name,size) \
108  len = avio_r8(pb); \
109  if (len < 1 || len > size) \
110  return -1; \
111  if (avio_read(pb, buf, size) == size && *buf) { \
112  buf[len] = 0; \
113  av_dict_set(&avctx->metadata, name, buf, 0); \
114  }
115 
116  GET_EFI2_META("filename", 12)
117  GET_EFI2_META("author", 20)
118  GET_EFI2_META("publisher", 20)
119  GET_EFI2_META("title", 35)
120 
121  return 0;
122 }
123 
124 static void predict_width(AVCodecParameters *par, uint64_t fsize, int got_width)
125 {
126  /** attempt to guess width */
127  if (!got_width)
128  par->width = fsize > 4000 ? (160<<3) : (80<<3);
129 }
130 
131 static int bin_probe(const AVProbeData *p)
132 {
133  const uint8_t *d = p->buf;
134  int magic = 0, sauce = 0;
135  int invisible = 0;
136  int i;
137 
138  if (p->buf_size > 256)
139  magic = !memcmp(d + p->buf_size - 256, next_magic, sizeof(next_magic));
140  if (p->buf_size > 128)
141  sauce = !memcmp(d + p->buf_size - 128, "SAUCE00", 7);
142 
143  if (magic)
144  return AVPROBE_SCORE_EXTENSION + 1;
145 
146  if (av_match_ext(p->filename, "bin")) {
147  AVCodecParameters par;
148  int got_width = 0;
149  par.width = par.height = 0;
150  if (sauce)
151  return AVPROBE_SCORE_EXTENSION + 1;
152 
153  predict_width(&par, p->buf_size, got_width);
154  if (par.width < 8)
155  return 0;
156  calculate_height(&par, p->buf_size);
157  if (par.height <= 0)
158  return 0;
159 
160  for (i = 0; i < p->buf_size - 256; i+=2) {
161  if ((d[i+1] & 15) == (d[i+1] >> 4) && d[i] && d[i] != 0xFF && d[i] != ' ') {
162  invisible ++;
163  }
164  }
165 
166  if (par.width * par.height * 2 / (8*16) == p->buf_size)
167  return AVPROBE_SCORE_MAX / 2;
168  return 0;
169  }
170 
171  if (sauce)
172  return 1;
173 
174  return 0;
175 }
176 
177 
178 static int bintext_read_header(AVFormatContext *s)
179 {
180  BinDemuxContext *bin = s->priv_data;
181  AVIOContext *pb = s->pb;
182  int ret;
183  AVStream *st = init_stream(s);
184  if (!st)
185  return AVERROR(ENOMEM);
187 
188  if ((ret = ff_alloc_extradata(st->codecpar, 2)) < 0)
189  return ret;
190  st->codecpar->extradata[0] = 16;
191  st->codecpar->extradata[1] = 0;
192 
193  if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
194  int got_width = 0;
195  bin->fsize = avio_size(pb);
196  if (ff_sauce_read(s, &bin->fsize, &got_width, 0) < 0)
197  next_tag_read(s, &bin->fsize);
198  if (!bin->width) {
199  predict_width(st->codecpar, bin->fsize, got_width);
200  if (st->codecpar->width < 8)
201  return AVERROR_INVALIDDATA;
202  calculate_height(st->codecpar, bin->fsize);
203  }
204  avio_seek(pb, 0, SEEK_SET);
205  }
206  return 0;
207 }
208 #endif /* CONFIG_BINTEXT_DEMUXER */
209 
210 #if CONFIG_XBIN_DEMUXER
211 static int xbin_probe(const AVProbeData *p)
212 {
213  const uint8_t *d = p->buf;
214 
215  if (AV_RL32(d) == MKTAG('X','B','I','N') && d[4] == 0x1A &&
216  AV_RL16(d+5) > 0 && AV_RL16(d+5) <= 160 &&
217  d[9] > 0 && d[9] <= 32)
218  return AVPROBE_SCORE_MAX;
219  return 0;
220 }
221 
222 static int xbin_read_header(AVFormatContext *s)
223 {
224  BinDemuxContext *bin = s->priv_data;
225  AVIOContext *pb = s->pb;
226  char fontheight, flags;
227  int ret;
228  AVStream *st = init_stream(s);
229  if (!st)
230  return AVERROR(ENOMEM);
231 
232  avio_skip(pb, 5);
233  st->codecpar->width = avio_rl16(pb)<<3;
234  st->codecpar->height = avio_rl16(pb);
235  fontheight = avio_r8(pb);
236  st->codecpar->height *= fontheight;
237  flags = avio_r8(pb);
238 
239  st->codecpar->extradata_size = 2;
240  if ((flags & BINTEXT_PALETTE))
241  st->codecpar->extradata_size += 48;
242  if ((flags & BINTEXT_FONT))
243  st->codecpar->extradata_size += fontheight * (flags & 0x10 ? 512 : 256);
245 
247  if (ret < 0)
248  return ret;
249  st->codecpar->extradata[0] = fontheight;
250  st->codecpar->extradata[1] = flags;
251  if (avio_read(pb, st->codecpar->extradata + 2, st->codecpar->extradata_size - 2) < 0)
252  return AVERROR(EIO);
253 
254  if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
255  bin->fsize = avio_size(pb) - 9 - st->codecpar->extradata_size;
256  ff_sauce_read(s, &bin->fsize, NULL, 0);
257  avio_seek(pb, 9 + st->codecpar->extradata_size, SEEK_SET);
258  }
259 
260  return 0;
261 }
262 #endif /* CONFIG_XBIN_DEMUXER */
263 
264 #if CONFIG_ADF_DEMUXER
265 static int adf_read_header(AVFormatContext *s)
266 {
267  BinDemuxContext *bin = s->priv_data;
268  AVIOContext *pb = s->pb;
269  AVStream *st;
270  int ret;
271 
272  if (avio_r8(pb) != 1)
273  return AVERROR_INVALIDDATA;
274 
275  st = init_stream(s);
276  if (!st)
277  return AVERROR(ENOMEM);
279 
280  if ((ret = ff_alloc_extradata(st->codecpar, 2 + 48 + 4096)) < 0)
281  return ret;
282  st->codecpar->extradata[0] = 16;
284 
285  if (avio_read(pb, st->codecpar->extradata + 2, 24) < 0)
286  return AVERROR(EIO);
287  avio_skip(pb, 144);
288  if (avio_read(pb, st->codecpar->extradata + 2 + 24, 24) < 0)
289  return AVERROR(EIO);
290  if (avio_read(pb, st->codecpar->extradata + 2 + 48, 4096) < 0)
291  return AVERROR(EIO);
292 
293  if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
294  int got_width = 0;
295  bin->fsize = avio_size(pb) - 1 - 192 - 4096;
296  st->codecpar->width = 80<<3;
297  ff_sauce_read(s, &bin->fsize, &got_width, 0);
298  if (st->codecpar->width < 8)
299  return AVERROR_INVALIDDATA;
300  if (!bin->width)
301  calculate_height(st->codecpar, bin->fsize);
302  avio_seek(pb, 1 + 192 + 4096, SEEK_SET);
303  }
304  return 0;
305 }
306 #endif /* CONFIG_ADF_DEMUXER */
307 
308 #if CONFIG_IDF_DEMUXER
309 static const uint8_t idf_magic[] = {
310  0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
311 };
312 
313 static int idf_probe(const AVProbeData *p)
314 {
315  if (p->buf_size < sizeof(idf_magic))
316  return 0;
317  if (!memcmp(p->buf, idf_magic, sizeof(idf_magic)))
318  return AVPROBE_SCORE_MAX;
319  return 0;
320 }
321 
322 static int idf_read_header(AVFormatContext *s)
323 {
324  BinDemuxContext *bin = s->priv_data;
325  AVIOContext *pb = s->pb;
326  AVStream *st;
327  int got_width = 0, ret;
328 
329  if (!(pb->seekable & AVIO_SEEKABLE_NORMAL))
330  return AVERROR(EIO);
331 
332  st = init_stream(s);
333  if (!st)
334  return AVERROR(ENOMEM);
336 
337  if ((ret = ff_alloc_extradata(st->codecpar, 2 + 48 + 4096)) < 0)
338  return ret;
339  st->codecpar->extradata[0] = 16;
341 
342  avio_seek(pb, avio_size(pb) - 4096 - 48, SEEK_SET);
343 
344  if (avio_read(pb, st->codecpar->extradata + 2 + 48, 4096) < 0)
345  return AVERROR(EIO);
346  if (avio_read(pb, st->codecpar->extradata + 2, 48) < 0)
347  return AVERROR(EIO);
348 
349  bin->fsize = avio_size(pb) - 12 - 4096 - 48;
350  ff_sauce_read(s, &bin->fsize, &got_width, 0);
351  if (st->codecpar->width < 8)
352  return AVERROR_INVALIDDATA;
353  if (!bin->width)
354  calculate_height(st->codecpar, bin->fsize);
355  avio_seek(pb, 12, SEEK_SET);
356  return 0;
357 }
358 #endif /* CONFIG_IDF_DEMUXER */
359 
361  AVPacket *pkt)
362 {
363  BinDemuxContext *bin = s->priv_data;
364 
365  if (bin->fsize > 0) {
366  if (av_get_packet(s->pb, pkt, bin->fsize) < 0)
367  return AVERROR(EIO);
368  bin->fsize = -1; /* done */
369  } else if (!bin->fsize) {
370  if (avio_feof(s->pb))
371  return AVERROR(EIO);
372  if (av_get_packet(s->pb, pkt, bin->chars_per_frame) < 0)
373  return AVERROR(EIO);
374  } else {
375  return AVERROR(EIO);
376  }
377 
379  return 0;
380 }
381 
382 #define OFFSET(x) offsetof(BinDemuxContext, x)
383 static const AVOption options[] = {
384  { "linespeed", "set simulated line speed (bytes per second)", OFFSET(chars_per_frame), AV_OPT_TYPE_INT, {.i64 = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
385  { "video_size", "set video size, such as 640x480 or hd720.", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
386  { "framerate", "set framerate (frames per second)", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
387  { NULL },
388 };
389 
390 #define CLASS(name) \
391 (const AVClass[1]){{ \
392  .class_name = name, \
393  .item_name = av_default_item_name, \
394  .option = options, \
395  .version = LIBAVUTIL_VERSION_INT, \
396 }}
397 
398 #if CONFIG_BINTEXT_DEMUXER
400  .name = "bin",
401  .long_name = NULL_IF_CONFIG_SMALL("Binary text"),
402  .priv_data_size = sizeof(BinDemuxContext),
403  .read_probe = bin_probe,
404  .read_header = bintext_read_header,
406  .priv_class = CLASS("Binary text demuxer"),
407 };
408 #endif
409 
410 #if CONFIG_XBIN_DEMUXER
412  .name = "xbin",
413  .long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text (XBIN)"),
414  .priv_data_size = sizeof(BinDemuxContext),
415  .read_probe = xbin_probe,
416  .read_header = xbin_read_header,
418  .priv_class = CLASS("eXtended BINary text (XBIN) demuxer"),
419 };
420 #endif
421 
422 #if CONFIG_ADF_DEMUXER
424  .name = "adf",
425  .long_name = NULL_IF_CONFIG_SMALL("Artworx Data Format"),
426  .priv_data_size = sizeof(BinDemuxContext),
427  .read_header = adf_read_header,
429  .extensions = "adf",
430  .priv_class = CLASS("Artworx Data Format demuxer"),
431 };
432 #endif
433 
434 #if CONFIG_IDF_DEMUXER
436  .name = "idf",
437  .long_name = NULL_IF_CONFIG_SMALL("iCE Draw File"),
438  .priv_data_size = sizeof(BinDemuxContext),
439  .read_probe = idf_probe,
440  .read_header = idf_read_header,
442  .extensions = "idf",
443  .priv_class = CLASS("iCE Draw File demuxer"),
444 };
445 #endif
AVCodecParameters::extradata
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: codec_par.h:75
av_clip
#define av_clip
Definition: common.h:95
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
opt.h
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: options.c:237
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:57
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:53
OFFSET
#define OFFSET(x)
Definition: bintext.c:382
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:238
AVOption
AVOption.
Definition: opt.h:251
AVCodecParameters::codec_tag
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: codec_par.h:65
AVProbeData::buf_size
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:456
avio_size
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition: aviobuf.c:352
AV_PKT_FLAG_KEY
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: packet.h:429
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:465
framerate
int framerate
Definition: h264_levels.c:65
return
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
Definition: filter_design.txt:264
ff_bintext_demuxer
const AVInputFormat ff_bintext_demuxer
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:697
BinDemuxContext::chars_per_frame
int chars_per_frame
characters to send decoder per frame; set by private options as characters per second,...
Definition: bintext.c:45
ff_idf_demuxer
const AVInputFormat ff_idf_demuxer
avio_rl16
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:743
AVRational::num
int num
Numerator.
Definition: rational.h:59
pkt
AVPacket * pkt
Definition: movenc.c:59
AVInputFormat
Definition: avformat.h:656
width
#define width
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:256
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:661
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:455
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:127
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
AVProbeData::filename
const char * filename
Definition: avformat.h:454
av_match_ext
int av_match_ext(const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
Definition: format.c:40
ff_xbin_demuxer
const AVInputFormat ff_xbin_demuxer
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
fsize
static int64_t fsize(FILE *f)
Definition: audiomatch.c:29
BinDemuxContext::width
int width
Definition: bintext.c:48
AVFormatContext
Format I/O context.
Definition: avformat.h:1213
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:1108
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:529
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
AVStream::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avformat.h:978
NULL
#define NULL
Definition: coverity.c:32
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
BinDemuxContext::framerate
AVRational framerate
frames per second (private option)
Definition: bintext.c:49
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:235
CLASS
#define CLASS(name)
Definition: bintext.c:390
AVFormatContext::pb
AVIOContext * pb
I/O context.
Definition: avformat.h:1255
parseutils.h
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:453
BinDemuxContext::fsize
uint64_t fsize
file size less metadata buffer
Definition: bintext.c:50
BINTEXT_PALETTE
#define BINTEXT_PALETTE
Definition: bintext.h:34
AVPROBE_SCORE_EXTENSION
#define AVPROBE_SCORE_EXTENSION
score for file extension
Definition: avformat.h:463
AVCodecParameters::extradata_size
int extradata_size
Size of the extradata content in bytes.
Definition: codec_par.h:79
AVIOContext
Bytestream IO Context.
Definition: avio.h:162
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
AV_CODEC_ID_IDF
@ AV_CODEC_ID_IDF
Definition: codec_id.h:560
AVIOContext::seekable
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition: avio.h:263
ff_sauce_read
int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
Definition: sauce.c:32
AV_CODEC_ID_BINTEXT
@ AV_CODEC_ID_BINTEXT
Definition: codec_id.h:558
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:632
height
#define height
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:380
ff_adf_demuxer
const AVInputFormat ff_adf_demuxer
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
read_packet
static int read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: bintext.c:360
AVCodecParameters::height
int height
Definition: codec_par.h:128
bintext.h
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:282
options
static const AVOption options[]
Definition: bintext.c:383
len
int len
Definition: vorbis_enc_data.h:426
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:102
init_stream
static AVStream * init_stream(AVFormatContext *s)
Definition: bintext.c:53
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:948
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:260
avformat.h
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
BINTEXT_FONT
#define BINTEXT_FONT
Definition: bintext.h:35
AVIO_SEEKABLE_NORMAL
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:41
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:641
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:347
AV_CODEC_ID_XBIN
@ AV_CODEC_ID_XBIN
Definition: codec_id.h:559
BinDemuxContext
Definition: bintext.c:43
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:61
AVPacket
This structure stores compressed data.
Definition: packet.h:351
sauce.h
d
d
Definition: ffmpeg_filter.c:153
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
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
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:238
avio_feof
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition: aviobuf.c:375