summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-01-24 20:46:58 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-01-24 20:46:58 +0100
commit1ae783dafc90c554961d819aedf91baa9d207d87 (patch)
tree9d5f57f25eebf8ddfe50fb03a51095b199b17167
parente1c319949d19cbc01a897065f143149b313a1693 (diff)
typefindfunctions: Add typefinder for ISO MP4 files
Fixes bug #607848.
-rw-r--r--gst/typefind/gsttypefindfunctions.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
index f8b88edd..8a7e6601 100644
--- a/gst/typefind/gsttypefindfunctions.c
+++ b/gst/typefind/gsttypefindfunctions.c
@@ -2230,6 +2230,7 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
guint tip = 0;
guint64 offset = 0;
guint64 size;
+ const gchar *variant = NULL;
while ((data = gst_type_find_peek (tf, offset, 12)) != NULL) {
guint64 new_offset;
@@ -2238,6 +2239,13 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
tip = GST_TYPE_FIND_MAXIMUM;
break;
}
+
+ if (STRNCMP (&data[4], "ftypisom", 8) == 0) {
+ tip = GST_TYPE_FIND_MAXIMUM;
+ variant = "iso";
+ 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 ||
@@ -2280,8 +2288,17 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
break;
offset = new_offset;
}
+
if (tip > 0) {
- gst_type_find_suggest (tf, tip, QT_CAPS);
+ if (variant) {
+ GstCaps *caps = gst_caps_copy (QT_CAPS);
+
+ gst_caps_set_simple (caps, "variant", G_TYPE_STRING, variant, NULL);
+ gst_type_find_suggest (tf, tip, caps);
+ gst_caps_unref (caps);
+ } else {
+ gst_type_find_suggest (tf, tip, QT_CAPS);
+ }
}
};