summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-08-18 12:56:33 +0300
committerSebastian Dröge <sebastian@centricular.com>2015-08-18 12:56:33 +0300
commit8a736f6e9883a0abe4a5038d7e45d31ae125ce1c (patch)
tree92b21dbc6f2823bf1c9e1b4fa5556963ac45a07b
parentfd7724b6e1114acde47360988ae38a4cf691f8a7 (diff)
typefindfunctions: Add typefinder for TTML+XML
Used in DASH among other things, as SMPTE Timed Text.
-rw-r--r--gst/typefind/gsttypefindfunctions.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
index 7c58e1f8b..2bedf18c4 100644
--- a/gst/typefind/gsttypefindfunctions.c
+++ b/gst/typefind/gsttypefindfunctions.c
@@ -655,6 +655,19 @@ smil_type_find (GstTypeFind * tf, gpointer unused)
}
}
+/*** application/ttml+xml *****************************************************/
+
+static GstStaticCaps ttml_xml_caps = GST_STATIC_CAPS ("application/ttml+xml");
+
+#define TTML_XML_CAPS (gst_static_caps_get(&ttml_xml_caps))
+static void
+ttml_xml_type_find (GstTypeFind * tf, gpointer unused)
+{
+ if (xml_check_first_element (tf, "tt", 2, FALSE)) {
+ gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, TTML_XML_CAPS);
+ }
+}
+
/*** text/html ***/
static GstStaticCaps html_caps = GST_STATIC_CAPS ("text/html");
@@ -5629,6 +5642,8 @@ plugin_init (GstPlugin * plugin)
sdp_type_find, "sdp", SDP_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/smil", GST_RANK_SECONDARY,
smil_type_find, "smil", SMIL_CAPS, NULL, NULL);
+ TYPE_FIND_REGISTER (plugin, "application/ttml+xml", GST_RANK_SECONDARY,
+ ttml_xml_type_find, "ttml+xml", TTML_XML_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/xml", GST_RANK_MARGINAL,
xml_type_find, "xml", GENERIC_XML_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_RIFF (plugin, "audio/x-wav", GST_RANK_PRIMARY, "wav",