ARG_WRITING_APP,
ARG_DOCTYPE_VERSION,
ARG_MIN_INDEX_INTERVAL,
- ARG_IS_LIVE
+ ARG_INDEXED
};
#define DEFAULT_DOCTYPE_VERSION 2
#define DEFAULT_WRITING_APP "GStreamer Matroska muxer"
#define DEFAULT_MIN_INDEX_INTERVAL 0
-#define DEFAULT_IS_LIVE FALSE
+#define DEFAULT_INDEXED TRUE
/* WAVEFORMATEX is gst_riff_strf_auds + an extra guint16 extension size */
#define WAVEFORMATEX_SIZE (2 + sizeof (gst_riff_strf_auds))
g_param_spec_int64 ("min-index-interval", "Minimum time between index "
"entries", "An index entry is created every so many nanoseconds.",
0, G_MAXINT64, DEFAULT_MIN_INDEX_INTERVAL, G_PARAM_READWRITE));
- g_object_class_install_property (gobject_class, ARG_IS_LIVE,
- g_param_spec_boolean ("is-live", "Is Live",
- "The stream is live and does not need an index", DEFAULT_IS_LIVE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, ARG_INDEXED,
+ g_param_spec_boolean ("indexed", "Determines whether output should be "
+ "indexed", "If set to false, the output should be as if it is to "
+ "be streamed and hence no indexes written or duration written.",
+ DEFAULT_INDEXED, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_matroska_mux_change_state);
mux->doctype_version = DEFAULT_DOCTYPE_VERSION;
mux->writing_app = g_strdup (DEFAULT_WRITING_APP);
mux->min_index_interval = DEFAULT_MIN_INDEX_INTERVAL;
- mux->is_live = DEFAULT_IS_LIVE;
+ mux->indexed = DEFAULT_INDEXED;
/* initialize internal variables */
mux->index = NULL;
gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_SEGMENT);
mux->segment_master = ebml->pos;
- if (!mux->is_live) {
+ if (mux->indexed) {
/* seekhead (table of contents) - we set the positions later */
mux->seekhead_pos = ebml->pos;
master = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_SEEKHEAD);
gst_ebml_write_uint (ebml, GST_MATROSKA_ID_TIMECODESCALE, mux->time_scale);
mux->duration_pos = ebml->pos;
/* get duration */
- if (!mux->is_live) {
+ if (mux->indexed) {
for (collected = mux->collect->data; collected;
collected = g_slist_next (collected)) {
GstMatroskaPad *collect_pad;
}
/* cues */
- if (mux->index != NULL && !mux->is_live) {
+ if (mux->index != NULL && mux->indexed) {
guint n;
guint64 master, pointentry_master, trackpos_master;
/* tags */
tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (mux));
- if (tags != NULL && !gst_tag_list_is_empty (tags) && !mux->is_live) {
+ if (tags != NULL && !gst_tag_list_is_empty (tags) && mux->indexed) {
guint64 master_tags, master_tag;
GST_DEBUG ("Writing tags");
* length pointer starts at 20.
* - all entries are local to the segment (so pos - segment_master).
* - so each entry is at 12 + 20 + num * 28. */
- if (!mux->is_live) {
+ if (mux->indexed) {
GST_DEBUG_OBJECT (mux, "not live");
gst_ebml_replace_uint (ebml, mux->seekhead_pos + 32,
mux->info_pos - mux->segment_master);
/* start a new cluster every two seconds or at keyframe */
if (mux->cluster_time + GST_SECOND * 2 < GST_BUFFER_TIMESTAMP (buf)
|| is_video_keyframe) {
- if (!mux->is_live)
+ if (mux->indexed)
gst_ebml_write_master_finish (ebml, mux->cluster);
mux->prev_cluster_size = ebml->pos - mux->cluster_pos;
mux->cluster_pos = ebml->pos;
case ARG_MIN_INDEX_INTERVAL:
mux->min_index_interval = g_value_get_int64 (value);
break;
- case ARG_IS_LIVE:
- mux->is_live = g_value_get_boolean (value);
+ case ARG_INDEXED:
+ mux->indexed = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
case ARG_MIN_INDEX_INTERVAL:
g_value_set_int64 (value, mux->min_index_interval);
break;
- case ARG_IS_LIVE:
- g_value_set_boolean (value, mux->is_live);
+ case ARG_INDEXED:
+ g_value_set_boolean (value, mux->indexed);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);