summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-12-15 17:09:59 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-12-15 17:09:59 +0000
commit6e2306d436330a379228930c6fc7e2205e868d69 (patch)
tree484dee9882738bcab69b42ceb1a2fc7dd078ad77 /libs
parent1affbe8e9fe491b258d9c990866e0c59cdcacce3 (diff)
libs/gst/base/gstcollectpads.c: Automatically activate/deactivate pads when they are added to a started/stoped collec...
Original commit message from CVS: * libs/gst/base/gstcollectpads.c: (gst_collect_pads_add_pad), (gst_collect_pads_remove_pad): Automatically activate/deactivate pads when they are added to a started/stoped collectpads.
Diffstat (limited to 'libs')
-rw-r--r--libs/gst/base/gstcollectpads.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c
index a4bedd745..62b20b360 100644
--- a/libs/gst/base/gstcollectpads.c
+++ b/libs/gst/base/gstcollectpads.c
@@ -206,6 +206,9 @@ gst_collect_pads_set_function (GstCollectPads * pads,
* You specify a size for the returned #GstCollectData structure
* so that you can use it to store additional information.
*
+ * The pad will be automatically activated in push mode when @pads is
+ * started.
+ *
* Returns: a new #GstCollectData to identify the new pad. Or NULL
* if wrong parameters are supplied.
*
@@ -240,6 +243,9 @@ gst_collect_pads_add_pad (GstCollectPads * pads, GstPad * pad, guint size)
gst_pad_set_chain_function (pad, GST_DEBUG_FUNCPTR (gst_collect_pads_chain));
gst_pad_set_event_function (pad, GST_DEBUG_FUNCPTR (gst_collect_pads_event));
gst_pad_set_element_private (pad, data);
+ /* activate the pad when needed */
+ if (pads->started)
+ gst_pad_set_active (pad, TRUE);
pads->abidata.ABI.pad_cookie++;
GST_COLLECT_PADS_PAD_UNLOCK (pads);
@@ -263,6 +269,8 @@ find_pad (GstCollectData * data, GstPad * pad)
* free the #GstCollectData and all the resources that were allocated with
* gst_collect_pads_add_pad().
*
+ * The pad will be deactivated automatically when @pads is stopped.
+ *
* Returns: %TRUE if the pad could be removed.
*
* MT safe.
@@ -298,6 +306,10 @@ gst_collect_pads_remove_pad (GstCollectPads * pads, GstPad * pad)
* crashes in the streaming thread */
gst_pad_set_element_private (pad, NULL);
+ /* deactivate the pad when needed */
+ if (!pads->started)
+ gst_pad_set_active (pad, FALSE);
+
/* backward compat, also remove from data if stopped */
if (!pads->started) {
GSList *dlist;