matroskamux: rename matroska_version to doctype_version

This commit is contained in:
Philip Jägenstedt 2010-05-09 12:35:10 +02:00 committed by Sebastian Dröge
parent 27069088db
commit 3b4759de18
2 changed files with 16 additions and 15 deletions

View file

@ -62,12 +62,12 @@ enum
ARG_0, ARG_0,
ARG_WRITING_APP, ARG_WRITING_APP,
ARG_DOCTYPE, ARG_DOCTYPE,
ARG_MATROSKA_VERSION, ARG_DOCTYPE_VERSION,
ARG_MIN_INDEX_INTERVAL ARG_MIN_INDEX_INTERVAL
}; };
#define DEFAULT_DOCTYPE GST_MATROSKA_DOCTYPE_MATROSKA #define DEFAULT_DOCTYPE GST_MATROSKA_DOCTYPE_MATROSKA
#define DEFAULT_MATROSKA_VERSION 1 #define DEFAULT_DOCTYPE_VERSION 1
#define DEFAULT_WRITING_APP "GStreamer Matroska muxer" #define DEFAULT_WRITING_APP "GStreamer Matroska muxer"
#define DEFAULT_MIN_INDEX_INTERVAL 0 #define DEFAULT_MIN_INDEX_INTERVAL 0
@ -303,10 +303,10 @@ gst_matroska_mux_class_init (GstMatroskaMuxClass * klass)
g_param_spec_enum ("doctype", "DocType.", g_param_spec_enum ("doctype", "DocType.",
"The type of document.", GST_TYPE_MATROSKA_DOCTYPE, "The type of document.", GST_TYPE_MATROSKA_DOCTYPE,
DEFAULT_DOCTYPE, G_PARAM_READWRITE)); DEFAULT_DOCTYPE, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_MATROSKA_VERSION, g_object_class_install_property (gobject_class, ARG_DOCTYPE_VERSION,
g_param_spec_int ("version", "Matroska version", g_param_spec_int ("version", "DocType version",
"This parameter determines what matroska features can be used.", "This parameter determines what matroska features can be used.",
1, 2, DEFAULT_MATROSKA_VERSION, G_PARAM_READWRITE)); 1, 2, DEFAULT_DOCTYPE_VERSION, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_MIN_INDEX_INTERVAL, g_object_class_install_property (gobject_class, ARG_MIN_INDEX_INTERVAL,
g_param_spec_int64 ("min-index-interval", "Minimum time between index " g_param_spec_int64 ("min-index-interval", "Minimum time between index "
"entries", "An index entry is created every so many nanoseconds.", "entries", "An index entry is created every so many nanoseconds.",
@ -344,7 +344,7 @@ gst_matroska_mux_init (GstMatroskaMux * mux, GstMatroskaMuxClass * g_class)
/* property defaults */ /* property defaults */
mux->doctype = DEFAULT_DOCTYPE; mux->doctype = DEFAULT_DOCTYPE;
mux->matroska_version = DEFAULT_MATROSKA_VERSION; mux->doctype_version = DEFAULT_DOCTYPE_VERSION;
mux->writing_app = g_strdup (DEFAULT_WRITING_APP); mux->writing_app = g_strdup (DEFAULT_WRITING_APP);
mux->min_index_interval = DEFAULT_MIN_INDEX_INTERVAL; mux->min_index_interval = DEFAULT_MIN_INDEX_INTERVAL;
@ -2010,8 +2010,8 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
doctype = doctype_value->value_nick; doctype = doctype_value->value_nick;
g_type_class_unref (doctype_class); g_type_class_unref (doctype_class);
GST_INFO_OBJECT (ebml, "DocType: %s, Version: %d", GST_INFO_OBJECT (ebml, "DocType: %s, Version: %d",
doctype, mux->matroska_version); doctype, mux->doctype_version);
gst_ebml_write_header (ebml, doctype, mux->matroska_version); gst_ebml_write_header (ebml, doctype, mux->doctype_version);
/* start a segment */ /* start a segment */
mux->segment_pos = mux->segment_pos =
@ -2612,7 +2612,8 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad)
relative_timestamp64 -= mux->time_scale / 2; relative_timestamp64 -= mux->time_scale / 2;
} }
relative_timestamp = relative_timestamp64 / (gint64) mux->time_scale; relative_timestamp = relative_timestamp64 / (gint64) mux->time_scale;
if (mux->matroska_version > 1 && !write_duration) { if (mux->doctype == GST_MATROSKA_DOCTYPE_MATROSKA && mux->doctype_version > 1
&& !write_duration) {
int flags = int flags =
GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT) ? 0 : 0x80; GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT) ? 0 : 0x80;
@ -2787,8 +2788,8 @@ gst_matroska_mux_set_property (GObject * object,
case ARG_DOCTYPE: case ARG_DOCTYPE:
mux->doctype = g_value_get_enum (value); mux->doctype = g_value_get_enum (value);
break; break;
case ARG_MATROSKA_VERSION: case ARG_DOCTYPE_VERSION:
mux->matroska_version = g_value_get_int (value); mux->doctype_version = g_value_get_int (value);
break; break;
case ARG_MIN_INDEX_INTERVAL: case ARG_MIN_INDEX_INTERVAL:
mux->min_index_interval = g_value_get_int64 (value); mux->min_index_interval = g_value_get_int64 (value);
@ -2815,8 +2816,8 @@ gst_matroska_mux_get_property (GObject * object,
case ARG_DOCTYPE: case ARG_DOCTYPE:
g_value_set_enum (value, mux->doctype); g_value_set_enum (value, mux->doctype);
break; break;
case ARG_MATROSKA_VERSION: case ARG_DOCTYPE_VERSION:
g_value_set_int (value, mux->matroska_version); g_value_set_int (value, mux->doctype_version);
break; break;
case ARG_MIN_INDEX_INTERVAL: case ARG_MIN_INDEX_INTERVAL:
g_value_set_int64 (value, mux->min_index_interval); g_value_set_int64 (value, mux->min_index_interval);

View file

@ -88,8 +88,8 @@ typedef struct _GstMatroskaMux {
/* EBML DocType. */ /* EBML DocType. */
gint doctype; gint doctype;
/* Matroska version. */ /* DocType version. */
guint matroska_version; guint doctype_version;
/* state */ /* state */
GstMatroskaMuxState state; GstMatroskaMuxState state;