diff --git a/ChangeLog b/ChangeLog index 0c8a68aaec..0ea4e50361 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-07-06 Tim-Philipp Müller + + Patch by: Lutz Mueller + + * gst/typefind/gsttypefindfunctions.c: (html_type_find), + (plugin_init): + Add typefinding for text/html (#346581). + 2006-07-06 Tim-Philipp Müller * gst/typefind/gsttypefindfunctions.c: (utf8_type_find), diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index d018d7bd58..c8fd9d4e6a 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -271,6 +271,33 @@ smil_type_find (GstTypeFind * tf, gpointer unused) } } +/*** text/html ***/ + +static GstStaticCaps html_caps = GST_STATIC_CAPS ("text/html"); + +#define HTML_CAPS gst_static_caps_get (&html_caps) + +static void +html_type_find (GstTypeFind * tf, gpointer unused) +{ + gchar *d, *data; + + data = (gchar *) gst_type_find_peek (tf, 0, 16); + if (!data) + return; + + if (!g_ascii_strncasecmp (data, "", 6) == 0) { + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, HTML_CAPS); + } + } +} + /*** video/x-fli ***/ static GstStaticCaps flx_caps = GST_STATIC_CAPS ("video/x-fli"); @@ -2343,6 +2370,7 @@ plugin_init (GstPlugin * plugin) static gchar *ape_exts[] = { "ape", NULL }; static gchar *uri_exts[] = { "ram", NULL }; static gchar *smil_exts[] = { "smil", NULL }; + static gchar *html_exts[] = { "htm", "html", NULL }; static gchar *xml_exts[] = { "xml", NULL }; static gchar *jpeg_exts[] = { "jpg", "jpe", "jpeg", NULL }; static gchar *gif_exts[] = { "gif", NULL }; @@ -2439,6 +2467,8 @@ plugin_init (GstPlugin * plugin) TYPE_FIND_REGISTER (plugin, "video/quicktime", GST_RANK_SECONDARY, qt_type_find, qt_exts, QT_CAPS, NULL, NULL); + TYPE_FIND_REGISTER (plugin, "text/html", GST_RANK_SECONDARY, html_type_find, + html_exts, HTML_CAPS, NULL, NULL); TYPE_FIND_REGISTER_START_WITH (plugin, "application/vnd.rn-realmedia", GST_RANK_SECONDARY, rm_exts, ".RMF", 4, GST_TYPE_FIND_MAXIMUM); TYPE_FIND_REGISTER (plugin, "application/x-shockwave-flash",