Commit 6e2306d4 authored by Wim Taymans's avatar Wim Taymans

libs/gst/base/gstcollectpads.c: Automatically activate/deactivate pads when...

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.
parent 1affbe8e
2006-12-15 Wim Taymans <wim@fluendo.com>
* 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.
2006-12-15 Wim Taymans <wim@fluendo.com>
* gst/gstelement.c: (gst_element_add_pad):
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment