From 97de4b217da00ac197021e94f7efd56ab1f8e11c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 1 Jun 2010 09:27:00 +0100 Subject: [PATCH] Revert "matroska: add temporary webm typefinder" This reverts commit d148ec0ad2053abb0c38fc681a8953292985388f. We depend on -base git now, which has a webm typefinder in the usual place. --- gst/matroska/matroska.c | 55 ------------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/gst/matroska/matroska.c b/gst/matroska/matroska.c index 6b66dc0..503e24d 100644 --- a/gst/matroska/matroska.c +++ b/gst/matroska/matroska.c @@ -28,62 +28,9 @@ #include "matroska-ids.h" #include "webm-mux.h" -#include - -/*** video/webm typefinder (temporary) ***/ -static GstStaticCaps webm_caps = GST_STATIC_CAPS ("video/webm"); - -#define WEBM_CAPS (gst_static_caps_get(&webm_caps)) -static void -webm_type_find (GstTypeFind * tf, gpointer ununsed) -{ - static const guint8 webm_doctype[] = { 'w', 'e', 'b', 'm' }; - guint8 *data; - gint len_mask = 0x80, size = 1, n = 1, total; - - /* 4 bytes for EBML ID, 1 byte for header length identifier */ - data = gst_type_find_peek (tf, 0, 4 + 1); - if (!data) - return; - - /* ebml header? */ - if (data[0] != 0x1A || data[1] != 0x45 || data[2] != 0xDF || data[3] != 0xA3) - return; - - /* length of header */ - total = data[4]; - while (size <= 8 && !(total & len_mask)) { - size++; - len_mask >>= 1; - } - if (size > 8) - return; - total &= (len_mask - 1); - while (n < size) - total = (total << 8) | data[4 + n++]; - - /* get new data for full header, 4 bytes for EBML ID, - * EBML length tag and the actual header */ - data = gst_type_find_peek (tf, 0, 4 + size + total); - if (!data) - return; - - /* the header must contain the document type 'webm'. For now, - * we don't parse the whole header but simply check for the - * availability of that array of characters inside the header. - * Not fully fool-proof, but good enough. */ - for (n = 4 + size; n <= 4 + size + total - sizeof (webm_doctype); n++) { - if (!memcmp (&data[n], webm_doctype, sizeof (webm_doctype))) { - gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, WEBM_CAPS); - return; - } - } -} - static gboolean plugin_init (GstPlugin * plugin) { - static const gchar *webm_exts[] = { "webm", "weba", "webv", NULL }; gboolean ret; gst_matroska_register_tags (); @@ -93,8 +40,6 @@ plugin_init (GstPlugin * plugin) GST_TYPE_MATROSKA_MUX); ret &= gst_element_register (plugin, "webmmux", GST_RANK_PRIMARY, GST_TYPE_WEBM_MUX); - ret &= gst_type_find_register (plugin, "good-webm", GST_RANK_MARGINAL, - webm_type_find, (gchar **) webm_exts, WEBM_CAPS, NULL, NULL); return ret; } -- 2.7.4