typefindfunctions: Add support HEIF file format finding

A HEIF compatiable file (i.e., mif1 brand) needs special concern
since 'moov' atom is not mandatory for the file although HEIF is
a variant of ISOBMFF

See http://standards.iso.org/ittf/PubliclyAvailableStandards/c066067_ISO_IEC_23008-12_2017.zip
This commit is contained in:
Seungha Yang 2019-04-12 12:09:31 +09:00
parent 4e80ea6473
commit 909b59dd55

View file

@ -3350,6 +3350,12 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
break;
}
if (STRNCMP (&data[4], "ftypmif1", 8) == 0) {
tip = GST_TYPE_FIND_MAXIMUM;
variant = "heif";
break;
}
/* box/atom types that are in common with ISO base media file format */
if (STRNCMP (&data[4], "moov", 4) == 0 ||
STRNCMP (&data[4], "mdat", 4) == 0 ||
@ -3395,6 +3401,10 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
tip = GST_TYPE_FIND_MAXIMUM;
variant = "iso";
goto done;
} else if (STRNCMP (&data[new_offset], "mif1", 4) == 0) {
tip = GST_TYPE_FIND_MAXIMUM;
variant = "heif";
goto done;
}
new_offset += 4;
}