73 #if CONFIG_BINTEXT_DEMUXER | CONFIG_ADF_DEMUXER | CONFIG_IDF_DEMUXER
77 static void calculate_height(
AVCodecContext *avctx, uint64_t fsize)
79 avctx->
height = (fsize / ((avctx->
width>>3)*2)) << 4;
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
96 if (
avio_read(pb, buf,
sizeof(next_magic)) !=
sizeof(next_magic))
98 if (memcmp(buf, next_magic,
sizeof(next_magic)))
105 #define GET_EFI2_META(name,size) \
107 if (len < 1 || len > size) \
109 if (avio_read(pb, buf, size) == size && *buf) { \
111 av_dict_set(&avctx->metadata, name, buf, 0); \
114 GET_EFI2_META(
"filename", 12)
115 GET_EFI2_META("author", 20)
116 GET_EFI2_META("publisher", 20)
117 GET_EFI2_META("title", 35)
122 static
void predict_width(
AVCodecContext *avctx, uint64_t fsize,
int got_width)
126 avctx->width = fsize > 4000 ? (160<<3) : (80<<3);
148 next_tag_read(s, &bin->
fsize);
150 predict_width(st->
codec, bin->
fsize, got_width);
159 #if CONFIG_XBIN_DEMUXER
164 if (
AV_RL32(d) ==
MKTAG(
'X',
'B',
'I',
'N') && d[4] == 0x1A &&
166 d[9] > 0 && d[9] <= 32)
175 char fontheight,
flags;
212 #if CONFIG_ADF_DEMUXER
253 #if CONFIG_IDF_DEMUXER
254 static const uint8_t idf_magic[] = {
255 0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
260 if (p->
buf_size <
sizeof(idf_magic))
262 if (!memcmp(p->
buf, idf_magic,
sizeof(idf_magic)))
308 if (bin->
fsize > 0) {
312 }
else if (!bin->
fsize) {
325 #define OFFSET(x) offsetof(BinDemuxContext, x)
333 #define CLASS(name) \
334 (const AVClass[1]){{ \
335 .class_name = name, \
336 .item_name = av_default_item_name, \
338 .version = LIBAVUTIL_VERSION_INT, \
341 #if CONFIG_BINTEXT_DEMUXER
349 .priv_class =
CLASS(
"Binary text demuxer"),
353 #if CONFIG_XBIN_DEMUXER
361 .priv_class =
CLASS(
"eXtended BINary text (XBIN) demuxer"),
365 #if CONFIG_ADF_DEMUXER
373 .priv_class =
CLASS(
"Artworx Data Format demuxer"),
377 #if CONFIG_IDF_DEMUXER
386 .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.
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.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
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
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.
static double av_q2d(AVRational a)
Convert rational to double.
static const AVOption options[]
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 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)
int flags
A combination of AV_PKT_FLAG values.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
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.
int width
picture width / height.
uint64_t fsize
file size less metadata buffer
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
AVRational framerate
frames per second (private option)
AVIOContext * pb
I/O context.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
BYTE int const BYTE int int int height
Describe the class of an AVClass context structure.
rational number numerator/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)
unsigned int avio_rl16(AVIOContext *s)
void * priv_data
Format private data.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
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)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.