33#include "config_components.h"
77#if CONFIG_BINTEXT_DEMUXER | CONFIG_ADF_DEMUXER | CONFIG_IDF_DEMUXER
87#if CONFIG_BINTEXT_DEMUXER
88static const uint8_t next_magic[]={
89 0x1A, 0x1B,
'[',
'0',
';',
'3',
'0',
';',
'4',
'0',
'm',
'N',
'E',
'X',
'T', 0x00
102 avio_seek(pb, start_pos - 256, SEEK_SET);
105 if (memcmp(buf, next_magic,
sizeof(next_magic)))
112#define GET_EFI2_META(name,size) \
114 if (len < 1 || len > size) \
116 if (avio_read(pb, buf, size) == size && *buf) { \
118 av_dict_set(&avctx->metadata, name, buf, 0); \
121 GET_EFI2_META(
"filename", 12)
122 GET_EFI2_META(
"author", 20)
123 GET_EFI2_META(
"publisher", 20)
124 GET_EFI2_META(
"title", 35)
133 par->width =
fsize > 4000 ? (160<<3) : (80<<3);
138 const uint8_t *d =
p->buf;
139 int magic = 0, sauce = 0;
141 if (
p->buf_size > 256)
142 magic = !memcmp(d +
p->buf_size - 256, next_magic,
sizeof(next_magic));
143 if (
p->buf_size > 128)
144 sauce = !memcmp(d +
p->buf_size - 128,
"SAUCE00", 7);
156 predict_width(&par,
p->buf_size, got_width);
159 calculate_height(&par,
p->buf_size);
194 next_tag_read(
s, &bin->
fsize);
207#if CONFIG_XBIN_DEMUXER
210 const uint8_t *d =
p->buf;
212 if (
AV_RL32(d) ==
MKTAG(
'X',
'B',
'I',
'N') && d[4] == 0x1A &&
214 d[9] > 0 && d[9] <= 32)
223 char fontheight,
flags;
264#if CONFIG_ADF_DEMUXER
296 if (
fsize < 1 + 192 + 4096)
311#if CONFIG_IDF_DEMUXER
312static const uint8_t idf_magic[] = {
313 0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
318 if (
p->buf_size <
sizeof(idf_magic))
320 if (!memcmp(
p->buf, idf_magic,
sizeof(idf_magic)))
330 int got_width = 0, ret;
347 if (
fsize < 12 + 4096 + 48)
373 if (bin->
fsize > 0) {
377 }
else if (!bin->
fsize) {
390#define OFFSET(x) offsetof(BinDemuxContext, x)
399(const AVClass[1]){{ \
400 .class_name = name, \
401 .item_name = av_default_item_name, \
403 .version = LIBAVUTIL_VERSION_INT, \
406#if CONFIG_BINTEXT_DEMUXER
410 .p.priv_class =
CLASS(
"Binary text demuxer"),
418#if CONFIG_XBIN_DEMUXER
422 .p.priv_class =
CLASS(
"eXtended BINary text (XBIN) demuxer"),
430#if CONFIG_ADF_DEMUXER
434 .p.extensions =
"adf",
435 .p.priv_class =
CLASS(
"Artworx Data Format demuxer"),
442#if CONFIG_IDF_DEMUXER
446 .p.extensions =
"idf",
447 .p.priv_class =
CLASS(
"iCE Draw File demuxer"),
static int64_t fsize(FILE *f)
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.
int64_t avio_size(AVIOContext *s)
Get the filesize.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_r8(AVIOContext *s)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
static int read_probe(const AVProbeData *p)
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
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.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static int read_packet(AVFormatContext *s, AVPacket *pkt)
static AVStream * init_stream(AVFormatContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKTAG(a, b, c, d)
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
Describe the class of an AVClass context structure.
This struct describes the properties of an encoded stream.
int extradata_size
Size of the extradata content in bytes.
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVIOContext * pb
I/O context.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
int height
video size (WxH pixels) (private option)
uint64_t fsize
file size less metadata buffer
AVRational framerate
frames per second (private option)
int chars_per_frame
characters to send decoder per frame; set by private options as characters per second,...