#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)
{
{
ARG_0,
ARG_WRITING_APP,
+ ARG_DOCTYPE,
ARG_MATROSKA_VERSION,
ARG_MIN_INDEX_INTERVAL
};
+#define DEFAULT_DOCTYPE GST_MATROSKA_DOCTYPE_MATROSKA
#define DEFAULT_MATROSKA_VERSION 1
#define DEFAULT_WRITING_APP "GStreamer Matroska muxer"
#define DEFAULT_MIN_INDEX_INTERVAL 0
g_param_spec_string ("writing-app", "Writing application.",
"The name the application that creates the matroska file.",
NULL, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, ARG_DOCTYPE,
+ g_param_spec_enum ("doctype", "DocType.",
+ "The type of document.", GST_TYPE_MATROSKA_DOCTYPE,
+ DEFAULT_DOCTYPE, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_MATROSKA_VERSION,
g_param_spec_int ("version", "Matroska version",
"This parameter determines what matroska features can be used.",
mux->ebml_write = gst_ebml_write_new (mux->srcpad);
/* property defaults */
+ mux->doctype = DEFAULT_DOCTYPE;
mux->matroska_version = DEFAULT_MATROSKA_VERSION;
mux->writing_app = g_strdup (DEFAULT_WRITING_APP);
mux->min_index_interval = DEFAULT_MIN_INDEX_INTERVAL;
gst_matroska_mux_start (GstMatroskaMux * mux)
{
GstEbmlWrite *ebml = mux->ebml_write;
+ GEnumClass *doctype_class;
+ GEnumValue *doctype_value;
+ const gchar *doctype;
guint32 seekhead_id[] = { GST_MATROSKA_ID_SEGMENTINFO,
GST_MATROSKA_ID_TRACKS,
GST_MATROSKA_ID_CUES,
GTimeVal time = { 0, 0 };
/* we start with a EBML header */
- gst_ebml_write_header (ebml, "matroska", mux->matroska_version);
+ doctype_class = g_type_class_ref (GST_TYPE_MATROSKA_DOCTYPE);
+ doctype_value = g_enum_get_value (doctype_class, mux->doctype);
+ doctype = doctype_value->value_nick;
+ g_type_class_unref (doctype_class);
+ GST_INFO_OBJECT (ebml, "DocType: %s, Version: %d",
+ doctype, mux->matroska_version);
+ gst_ebml_write_header (ebml, doctype, mux->matroska_version);
/* start a segment */
mux->segment_pos =
g_free (mux->writing_app);
mux->writing_app = g_value_dup_string (value);
break;
+ case ARG_DOCTYPE:
+ mux->doctype = g_value_get_enum (value);
+ break;
case ARG_MATROSKA_VERSION:
mux->matroska_version = g_value_get_int (value);
break;
case ARG_WRITING_APP:
g_value_set_string (value, mux->writing_app);
break;
+ case ARG_DOCTYPE:
+ g_value_set_enum (value, mux->doctype);
+ break;
case ARG_MATROSKA_VERSION:
g_value_set_int (value, mux->matroska_version);
break;