summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Queralt <xqueralt@gmail.com>2010-05-20 23:39:59 +0200
committerZaheer Abbas Merali <zaheerabbas@merali.org>2010-06-01 16:43:02 +0100
commit032d9b90ffa763773d43a586a7b336751c2928b7 (patch)
tree865864bbe4dba625054b1214aa9d37aac0a54acd
parentfb3a8cd47f0d4fd5af8d5fbecb9ec89d5b9d7034 (diff)
Add is-live property
-rw-r--r--gst/matroska/matroska-mux.c15
-rw-r--r--gst/matroska/matroska-mux.h1
2 files changed, 15 insertions, 1 deletions
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index 1ad7ee155..54e8c03e5 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -62,12 +62,14 @@ enum
ARG_0,
ARG_WRITING_APP,
ARG_DOCTYPE_VERSION,
- ARG_MIN_INDEX_INTERVAL
+ ARG_MIN_INDEX_INTERVAL,
+ ARG_IS_LIVE
};
#define DEFAULT_DOCTYPE_VERSION 2
#define DEFAULT_WRITING_APP "GStreamer Matroska muxer"
#define DEFAULT_MIN_INDEX_INTERVAL 0
+#define DEFAULT_IS_LIVE FALSE
/* WAVEFORMATEX is gst_riff_strf_auds + an extra guint16 extension size */
#define WAVEFORMATEX_SIZE (2 + sizeof (gst_riff_strf_auds))
@@ -303,6 +305,10 @@ gst_matroska_mux_class_init (GstMatroskaMuxClass * klass)
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));
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_matroska_mux_change_state);
@@ -344,6 +350,7 @@ gst_matroska_mux_init (GstMatroskaMux * mux, GstMatroskaMuxClass * g_class)
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;
/* initialize internal variables */
mux->index = NULL;
@@ -2792,6 +2799,9 @@ gst_matroska_mux_set_property (GObject * object,
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);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -2817,6 +2827,9 @@ gst_matroska_mux_get_property (GObject * object,
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);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/gst/matroska/matroska-mux.h b/gst/matroska/matroska-mux.h
index f2c7d4f3e..db1644208 100644
--- a/gst/matroska/matroska-mux.h
+++ b/gst/matroska/matroska-mux.h
@@ -98,6 +98,7 @@ typedef struct _GstMatroskaMux {
GstMatroskaIndex *index;
guint num_indexes;
GstClockTimeDiff min_index_interval;
+ gboolean is_live;
/* timescale in the file */
guint64 time_scale;