summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin YANG <oxcsnicho@gmail.com>2009-07-11 17:44:54 +0800
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-31 09:18:40 +0200
commit9f90dfee3efff44b37054b92a3dcb15c511d0021 (patch)
tree6f2dbedd4ac3cc20cc9da01b878b4559ed64ee3a
parentbaced65049dee113d577502f154e9c24b0c1bb4b (diff)
mpegtsmux: Add new property prog-map to the muxer
-rw-r--r--gst/mpegtsmux/mpegtsmux.c27
-rw-r--r--gst/mpegtsmux/mpegtsmux.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index edda26005..cdadb6b45 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -96,6 +96,7 @@ GST_DEBUG_CATEGORY (mpegtsmux_debug);
enum
{
ARG_0,
+ ARG_PROG_MAP,
ARG_M2TS_MODE
};
@@ -180,6 +181,11 @@ mpegtsmux_class_init (MpegTsMuxClass * klass)
gstelement_class->release_pad = mpegtsmux_release_pad;
gstelement_class->change_state = mpegtsmux_change_state;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PROG_MAP,
+ g_param_spec_boxed ("prog-map", "Program map",
+ "A GstStructure specifies the mapping from elementary streams to programs",
+ GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_M2TS_MODE,
g_param_spec_boolean ("m2ts_mode", "M2TS(192 bytes) Mode",
"Defines what packet size to use, normal TS format ie .ts(188 bytes) "
@@ -210,6 +216,8 @@ mpegtsmux_init (MpegTsMux * mux, MpegTsMuxClass * g_class)
mux->m2ts_mode = FALSE;
mux->first_pcr = TRUE;
mux->last_ts = 0;
+
+ mux->prog_map = NULL;
}
static void
@@ -230,6 +238,10 @@ mpegtsmux_dispose (GObject * object)
tsmux_free (mux->tsmux);
mux->tsmux = NULL;
}
+ if (mux->prog_map) {
+ gst_structure_free (mux->prog_map);
+ mux->prog_map = NULL;
+ }
GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
@@ -245,6 +257,18 @@ gst_mpegtsmux_set_property (GObject * object, guint prop_id,
/*set incase if the output stream need to be of 192 bytes */
mux->m2ts_mode = g_value_get_boolean (value);
break;
+ case ARG_PROG_MAP:
+ {
+ const GstStructure *s = gst_value_get_structure (value);
+ if (mux->prog_map) {
+ gst_structure_free (mux->prog_map);
+ }
+ if (s)
+ mux->prog_map = gst_structure_copy (s);
+ else
+ mux->prog_map = NULL;
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -261,6 +285,9 @@ gst_mpegtsmux_get_property (GObject * object, guint prop_id,
case ARG_M2TS_MODE:
g_value_set_boolean (value, mux->m2ts_mode);
break;
+ case ARG_PROG_MAP:
+ gst_value_set_structure (value, mux->prog_map);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/gst/mpegtsmux/mpegtsmux.h b/gst/mpegtsmux/mpegtsmux.h
index bb46d4757..6e639cbb4 100644
--- a/gst/mpegtsmux/mpegtsmux.h
+++ b/gst/mpegtsmux/mpegtsmux.h
@@ -110,6 +110,7 @@ struct MpegTsMux {
TsMux *tsmux;
TsMuxProgram *program;
+ GstStructure *prog_map;
gboolean first;
TsMuxStream *pcr_stream;