summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-05-20 20:01:58 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-05-20 21:49:43 +0200
commit82e4807d108e6e702f8b8acf57142ce4cfacde09 (patch)
treeae4e37d97f1265df3b4aa70d6103645e27e50c52
parent6a25cd475cd2d823cb994c82db50834802ad8eed (diff)
matroska: Remove the doctype enum, it's not needed anymore
-rw-r--r--gst/matroska/matroska-demux.c8
-rw-r--r--gst/matroska/matroska-ids.c17
-rw-r--r--gst/matroska/matroska-ids.h9
-rw-r--r--gst/matroska/matroska-mux.c4
4 files changed, 7 insertions, 31 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index a311b4afd..ec27329f9 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -2576,11 +2576,8 @@ gst_matroska_demux_parse_header (GstMatroskaDemux * demux)
ret = GST_FLOW_ERROR;
if (doctype) {
- GEnumClass *doctype_class;
- GEnumValue *doctype_value;
- doctype_class = g_type_class_ref (GST_TYPE_MATROSKA_DOCTYPE);
- doctype_value = g_enum_get_value_by_nick (doctype_class, doctype);
- if (doctype_value) {
+ if (g_str_equal (doctype, GST_MATROSKA_DOCTYPE_MATROSKA) ||
+ g_str_equal (doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
if (version <= 2) {
GST_INFO_OBJECT (demux, "Input is %s version %d", doctype, version);
ret = GST_FLOW_OK;
@@ -2593,7 +2590,6 @@ gst_matroska_demux_parse_header (GstMatroskaDemux * demux)
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, (NULL),
("Input is not a matroska stream (doctype=%s)", doctype));
}
- g_type_class_unref (doctype_class);
g_free (doctype);
} else {
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, (NULL),
diff --git a/gst/matroska/matroska-ids.c b/gst/matroska/matroska-ids.c
index b7153ba4e..0ee39d31e 100644
--- a/gst/matroska/matroska-ids.c
+++ b/gst/matroska/matroska-ids.c
@@ -26,23 +26,6 @@
#include "matroska-ids.h"
-GType
-gst_matroska_doctype_get_type (void)
-{
- static GType doctype_type = 0;
-
- static const GEnumValue doctype_types[] = {
- {GST_MATROSKA_DOCTYPE_MATROSKA, "Matroska", "matroska"},
- {GST_MATROSKA_DOCTYPE_WEBM, "WebM", "webm"},
- {0, NULL, NULL}
- };
-
- if (!doctype_type) {
- doctype_type = g_enum_register_static ("GstMatroskaDoctype", doctype_types);
- }
- return doctype_type;
-}
-
gboolean
gst_matroska_track_init_video_context (GstMatroskaTrackContext ** p_context)
{
diff --git a/gst/matroska/matroska-ids.h b/gst/matroska/matroska-ids.h
index c6bc43303..085bf8409 100644
--- a/gst/matroska/matroska-ids.h
+++ b/gst/matroska/matroska-ids.h
@@ -27,14 +27,11 @@
#include "ebml-ids.h"
/*
- * EBML DocType. enum.
+ * EBML DocType.
*/
-#define GST_MATROSKA_DOCTYPE_MATROSKA 0
-#define GST_MATROSKA_DOCTYPE_WEBM 1
-
-#define GST_TYPE_MATROSKA_DOCTYPE (gst_matroska_doctype_get_type())
-extern GType gst_matroska_doctype_get_type (void);
+#define GST_MATROSKA_DOCTYPE_MATROSKA "matroska"
+#define GST_MATROSKA_DOCTYPE_WEBM "webm"
/*
* Matroska element IDs. max. 32-bit.
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index b4182d563..235d19af4 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -340,9 +340,9 @@ gst_matroska_mux_init (GstMatroskaMux * mux, GstMatroskaMuxClass * g_class)
mux);
mux->ebml_write = gst_ebml_write_new (mux->srcpad);
+ mux->doctype = GST_MATROSKA_DOCTYPE_MATROSKA;
/* property defaults */
- mux->doctype = "matroska";
mux->doctype_version = DEFAULT_DOCTYPE_VERSION;
mux->writing_app = g_strdup (DEFAULT_WRITING_APP);
mux->min_index_interval = DEFAULT_MIN_INDEX_INTERVAL;
@@ -2880,7 +2880,7 @@ gst_webm_mux_class_init (GstWebMMuxClass * klass)
static void
gst_webm_mux_init (GstWebMMux * mux, GstWebMMuxClass * g_class)
{
- mux->doctype = "webm";
+ mux->doctype = GST_MATROSKA_DOCTYPE_WEBM;
}
gboolean