From 7240e2e38cf37c648edda0ae10c2b9be3480ec03 Mon Sep 17 00:00:00 2001 From: Alex Ashley Date: Mon, 10 Jun 2013 16:06:21 +0100 Subject: [PATCH] typefind: Added "dash" and "avc3" fourCC codes to qt_type_find. This commit adds detection of the "dash" and "avc3" compatible brands in qt_type_find. Amendment 2 of ISO/IEC 14496-15 (AVC file format) is defining a new structure for fragmented MP4 called "avc3". The principal difference between AVC1 and AVC3 is the location of the codec initialisation data (e.g. SPS, PPS). In AVC1 this data is placed in the initial MOOV box (moov.trak.mdia.minf.stbl.stsd.avc1) but in AVC3 this data goes in the first sample of every fragment (i.e. the first sample in each mdat box). The principal reason for avc3 is to make it easier for client implementations, because it removes the requirement to insert the SPS+PPS in to the decoder pipeline every time there is a representation change. https://bugzilla.gnome.org/show_bug.cgi?id=702004 --- gst/typefind/gsttypefindfunctions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 8ceb20f891..93021b41e7 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -3011,7 +3011,8 @@ qt_type_find (GstTypeFind * tf, gpointer unused) break; } - if (STRNCMP (&data[4], "ftypisml", 8) == 0) { + if (STRNCMP (&data[4], "ftypisml", 8) == 0 || + STRNCMP (&data[4], "ftypavc3", 8) == 0) { tip = GST_TYPE_FIND_MAXIMUM; variant = "iso-fragmented"; break; @@ -3051,7 +3052,9 @@ qt_type_find (GstTypeFind * tf, gpointer unused) if (data == NULL) goto done; if (STRNCMP (&data[4], "isom", 4) == 0 || + STRNCMP (&data[4], "dash", 4) == 0 || STRNCMP (&data[4], "avc1", 4) == 0 || + STRNCMP (&data[4], "avc3", 4) == 0 || STRNCMP (&data[4], "mp41", 4) == 0 || STRNCMP (&data[4], "mp42", 4) == 0) { tip = GST_TYPE_FIND_MAXIMUM;