87 #if CONFIG_BINTEXT_DEMUXER | CONFIG_ADF_DEMUXER | CONFIG_IDF_DEMUXER
91 static void calculate_height(
AVCodecContext *avctx, uint64_t fsize)
93 avctx->
height = (fsize / ((avctx->
width>>3)*2)) << 4;
97 #if CONFIG_BINTEXT_DEMUXER
98 static const uint8_t next_magic[]={
99 0x1A, 0x1B,
'[',
'0',
';',
'3',
'0',
';',
'4',
'0',
'm',
'N',
'E',
'X',
'T', 0x00
107 uint64_t start_pos =
avio_size(pb) - 256;
110 if (
avio_read(pb, buf,
sizeof(next_magic)) !=
sizeof(next_magic))
112 if (memcmp(buf, next_magic,
sizeof(next_magic)))
119 #define GET_EFI2_META(name,size) \
121 if (len < 1 || len > size) \
123 if (avio_read(pb, buf, size) == size && *buf) { \
125 av_dict_set(&avctx->metadata, name, buf, 0); \
128 GET_EFI2_META(
"filename", 12)
129 GET_EFI2_META("author", 20)
130 GET_EFI2_META("publisher", 20)
131 GET_EFI2_META("title", 35)
136 static
void predict_width(
AVCodecContext *avctx, uint64_t fsize,
int got_width)
140 avctx->width = fsize > 4000 ? (160<<3) : (80<<3);
164 next_tag_read(s, &bin->
fsize);
166 predict_width(st->
codec, bin->
fsize, got_width);
175 #if CONFIG_XBIN_DEMUXER
180 if (
AV_RL32(d) ==
MKTAG(
'X',
'B',
'I',
'N') && d[4] == 0x1A &&
182 d[9] > 0 && d[9] <= 32)
191 char fontheight,
flags;
229 #if CONFIG_ADF_DEMUXER
272 #if CONFIG_IDF_DEMUXER
273 static const uint8_t idf_magic[] = {
274 0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
279 if (p->
buf_size <
sizeof(idf_magic))
281 if (!memcmp(p->
buf, idf_magic,
sizeof(idf_magic)))
329 if (bin->
fsize > 0) {
333 }
else if (!bin->
fsize) {
346 #define OFFSET(x) offsetof(BinDemuxContext, x)
354 #define CLASS(name) \
355 (const AVClass[1]){{ \
356 .class_name = name, \
357 .item_name = av_default_item_name, \
359 .version = LIBAVUTIL_VERSION_INT, \
362 #if CONFIG_BINTEXT_DEMUXER
370 .priv_class =
CLASS(
"Binary text demuxer"),
374 #if CONFIG_XBIN_DEMUXER
382 .priv_class =
CLASS(
"eXtended BINary text (XBIN) demuxer"),
386 #if CONFIG_ADF_DEMUXER
394 .priv_class =
CLASS(
"Artworx Data Format demuxer"),
398 #if CONFIG_IDF_DEMUXER
407 .priv_class =
CLASS(
"iCE Draw File demuxer"),