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;
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),
#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)
{
#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.
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;
static void
gst_webm_mux_init (GstWebMMux * mux, GstWebMMuxClass * g_class)
{
- mux->doctype = "webm";
+ mux->doctype = GST_MATROSKA_DOCTYPE_WEBM;
}
gboolean