42 #define ID_8SVX MKTAG('8','S','V','X')
43 #define ID_16SV MKTAG('1','6','S','V')
44 #define ID_MAUD MKTAG('M','A','U','D')
45 #define ID_MHDR MKTAG('M','H','D','R')
46 #define ID_MDAT MKTAG('M','D','A','T')
47 #define ID_VHDR MKTAG('V','H','D','R')
48 #define ID_ATAK MKTAG('A','T','A','K')
49 #define ID_RLSE MKTAG('R','L','S','E')
50 #define ID_CHAN MKTAG('C','H','A','N')
51 #define ID_PBM MKTAG('P','B','M',' ')
52 #define ID_ILBM MKTAG('I','L','B','M')
53 #define ID_BMHD MKTAG('B','M','H','D')
54 #define ID_DGBL MKTAG('D','G','B','L')
55 #define ID_CAMG MKTAG('C','A','M','G')
56 #define ID_CMAP MKTAG('C','M','A','P')
57 #define ID_ACBM MKTAG('A','C','B','M')
58 #define ID_DEEP MKTAG('D','E','E','P')
59 #define ID_RGB8 MKTAG('R','G','B','8')
60 #define ID_RGBN MKTAG('R','G','B','N')
61 #define ID_DSD MKTAG('D','S','D',' ')
62 #define ID_ANIM MKTAG('A','N','I','M')
64 #define ID_FORM MKTAG('F','O','R','M')
65 #define ID_FRM8 MKTAG('F','R','M','8')
66 #define ID_ANNO MKTAG('A','N','N','O')
67 #define ID_AUTH MKTAG('A','U','T','H')
68 #define ID_CHRS MKTAG('C','H','R','S')
69 #define ID_COPYRIGHT MKTAG('(','c',')',' ')
70 #define ID_CSET MKTAG('C','S','E','T')
71 #define ID_FVER MKTAG('F','V','E','R')
72 #define ID_NAME MKTAG('N','A','M','E')
73 #define ID_TEXT MKTAG('T','E','X','T')
74 #define ID_ABIT MKTAG('A','B','I','T')
75 #define ID_BODY MKTAG('B','O','D','Y')
76 #define ID_DBOD MKTAG('D','B','O','D')
77 #define ID_DPEL MKTAG('D','P','E','L')
78 #define ID_DLOC MKTAG('D','L','O','C')
79 #define ID_TVDC MKTAG('T','V','D','C')
93 #define IFF_EXTRA_VIDEO_SIZE 41
120 const char *
const tag,
121 const unsigned data_size)
128 if (
avio_read(s->
pb, buf, data_size) != data_size) {
164 #define DSD_SLFT MKTAG('S','L','F','T')
165 #define DSD_SRGT MKTAG('S','R','G','T')
166 #define DSD_MLFT MKTAG('M','L','F','T')
167 #define DSD_MRGT MKTAG('M','R','G','T')
168 #define DSD_C MKTAG('C',' ',' ',' ')
169 #define DSD_LS MKTAG('L','S',' ',' ')
170 #define DSD_RS MKTAG('R','S',' ',' ')
171 #define DSD_LFE MKTAG('L','F','E',' ')
195 "dsd_source_comment",
196 "analogue_source_comment",
197 "pcm_source_comment",
216 const char * metadata_tag = NULL;
219 case MKTAG(
'D',
'I',
'A',
'R'): metadata_tag =
"artist";
break;
220 case MKTAG(
'D',
'I',
'T',
'I'): metadata_tag =
"title";
break;
223 if (metadata_tag && size > 4) {
252 case MKTAG(
'A',
'B',
'S',
'S'):
258 snprintf(abss,
sizeof(abss),
"%02dh:%02dm:%02ds:%d", hour, min, sec,
avio_rb32(pb));
262 case MKTAG(
'C',
'H',
'N',
'L'):
285 case MKTAG(
'C',
'M',
'P',
'R'):
291 case MKTAG(
'F',
'S',
' ',
' '):
297 case MKTAG(
'I',
'D',
'3',
' '):
298 id3v2_extra_meta = NULL;
300 if (id3v2_extra_meta) {
314 case MKTAG(
'L',
'S',
'C',
'O'):
318 if (config != 0xFFFF) {
333 static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
334 static const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
335 static const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
336 static const uint8_t deep_argb[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8};
337 static const uint8_t deep_abgr[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8};
347 uint32_t screenmode = 0, num, den;
348 unsigned transparency = 0;
349 unsigned masking = 0;
375 const char *metadata_tag = NULL;
389 if (data_size >= 16) {
446 if (data_size < 3 || data_size > 768 || data_size % 3) {
471 if (data_size >= 14) {
475 if (data_size >= 16) {
482 if (data_size < 4 || (data_size & 3))
484 if ((fmt_size =
avio_read(pb, fmt,
sizeof(fmt))) < 0)
522 if (data_size <
sizeof(iff->
tvdc))
530 case ID_TEXT: metadata_tag =
"comment";
break;
531 case ID_AUTH: metadata_tag =
"artist";
break;
533 case ID_NAME: metadata_tag =
"title";
break;
537 case MKTAG(
'F',
'V',
'E',
'R'):
541 av_log(s,
AV_LOG_DEBUG,
"DSIFF v%d.%d.%d.%d\n",version >> 24, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
545 case MKTAG(
'D',
'I',
'I',
'N'):
551 case MKTAG(
'P',
'R',
'O',
'P'):
563 case MKTAG(
'C',
'O',
'M',
'T'):
567 for (i = 0; i < nb_comments; i++) {
568 int year, mon, day, hour,
min,
type, ref;
578 snprintf(tmp,
sizeof(tmp),
"%04d-%02d-%02d %02d:%02d", year, mon, day, hour, min);
586 tag =
"channel_comment";
588 snprintf(tmp,
sizeof(tmp),
"channel%d_comment", ref);
608 if (metadata_size & 1)
615 if ((res =
get_metadata(s, metadata_tag, data_size)) < 0) {
669 if ((screenmode & 0x800 ) && iff->
bpp <= 8) {
670 iff->
ham = iff->
bpp > 6 ? 6 : 4;
673 iff->
flags = (screenmode & 0x80 ) && iff->
bpp <= 8;
687 bytestream_put_byte(&buf, iff->
bpp);
688 bytestream_put_byte(&buf, iff->
ham);
689 bytestream_put_byte(&buf, iff->
flags);
691 bytestream_put_byte(&buf, iff->
masking);
728 bytestream_put_be16(&buf, 2);
732 }
else if (ret < iff->body_size)