From 909b59dd55f94a2c442de07b23e100ab6e1c230c Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 12 Apr 2019 12:09:31 +0900 Subject: [PATCH] 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 --- gst/typefind/gsttypefindfunctions.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 11cee9af54..46dd399673 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -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; }