73 #if CONFIG_BINTEXT_DEMUXER | CONFIG_ADF_DEMUXER | CONFIG_IDF_DEMUXER 83 #if CONFIG_BINTEXT_DEMUXER 84 static const uint8_t next_magic[]={
85 0x1A, 0x1B,
'[',
'0',
';',
'3',
'0',
';',
'4',
'0',
'm',
'N',
'E',
'X',
'T', 0x00
99 if (
avio_read(pb, buf,
sizeof(next_magic)) !=
sizeof(next_magic))
101 if (memcmp(buf, next_magic,
sizeof(next_magic)))
108 #define GET_EFI2_META(name,size) \ 110 if (len < 1 || len > size) \ 112 if (avio_read(pb, buf, size) == size && *buf) { \ 114 av_dict_set(&avctx->metadata, name, buf, 0); \ 117 GET_EFI2_META(
"filename", 12)
118 GET_EFI2_META(
"author", 20)
119 GET_EFI2_META(
"publisher", 20)
120 GET_EFI2_META(
"title", 35)
129 par->
width =
fsize > 4000 ? (160<<3) : (80<<3);
135 int magic = 0, sauce = 0;
140 magic = !memcmp(d + p->
buf_size - 256, next_magic,
sizeof(next_magic));
142 sauce = !memcmp(d + p->
buf_size - 128,
"SAUCE00", 7);
154 predict_width(&par, p->
buf_size, got_width);
157 calculate_height(&par, p->
buf_size);
161 for (i = 0; i < p->
buf_size - 256; i+=2) {
162 if ((d[i+1] & 15) == (d[i+1] >> 4) && d[i] && d[i] != 0xFF && d[i] !=
' ') {
198 next_tag_read(s, &bin->
fsize);
211 #if CONFIG_XBIN_DEMUXER 216 if (
AV_RL32(d) ==
MKTAG(
'X',
'B',
'I',
'N') && d[4] == 0x1A &&
218 d[9] > 0 && d[9] <= 32)
227 char fontheight,
flags;
257 if (fsize < 9 + st->codecpar->extradata_size)
268 #if CONFIG_ADF_DEMUXER 300 if (fsize < 1 + 192 + 4096)
302 bin->
fsize = fsize - 1 - 192 - 4096;
315 #if CONFIG_IDF_DEMUXER 316 static const uint8_t idf_magic[] = {
317 0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
322 if (p->
buf_size <
sizeof(idf_magic))
324 if (!memcmp(p->
buf, idf_magic,
sizeof(idf_magic)))
334 int got_width = 0, ret;
351 if (fsize < 12 + 4096 + 48)
353 bin->
fsize = fsize - 12 - 4096 - 48;
377 if (bin->
fsize > 0) {
381 }
else if (!bin->
fsize) {
394 #define OFFSET(x) offsetof(BinDemuxContext, x) 402 #define CLASS(name) \ 403 (const AVClass[1]){{ \ 404 .class_name = name, \ 405 .item_name = av_default_item_name, \ 407 .version = LIBAVUTIL_VERSION_INT, \ 410 #if CONFIG_BINTEXT_DEMUXER 418 .priv_class =
CLASS(
"Binary text demuxer"),
422 #if CONFIG_XBIN_DEMUXER 430 .priv_class =
CLASS(
"eXtended BINary text (XBIN) demuxer"),
434 #if CONFIG_ADF_DEMUXER 442 .priv_class =
CLASS(
"Artworx Data Format demuxer"),
446 #if CONFIG_IDF_DEMUXER 455 .priv_class =
CLASS(
"iCE Draw File demuxer"),
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t avio_size(AVIOContext *s)
Get the filesize.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
This struct describes the properties of an encoded stream.
int chars_per_frame
characters to send decoder per frame; set by private options as characters per second, and then converted to characters per frame at runtime
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static const AVOption options[]
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.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define i(width, name, range_min, range_max)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
enum AVMediaType codec_type
General type of the encoded data.
int flags
A combination of AV_PKT_FLAG values.
int extradata_size
Size of the extradata content in bytes.
int avio_r8(AVIOContext *s)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
uint64_t fsize
file size less metadata buffer
static int read_header(FFV1Context *f)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
AVRational framerate
frames per second (private option)
AVIOContext * pb
I/O context.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
offset must point to AVRational
static int read_packet(AVFormatContext *s, AVPacket *pkt)
offset must point to two consecutive integers
This structure contains the data a format has to probe a file.
static AVStream * init_stream(AVFormatContext *s)
#define flags(name, subs,...)
unsigned int avio_rl16(AVIOContext *s)
void * priv_data
Format private data.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
static int64_t fsize(FILE *f)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define MKTAG(a, b, c, d)
This structure stores compressed data.