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.
This commit is contained in:
Wim Taymans 2006-12-15 17:09:59 +00:00
parent 1affbe8e9f
commit 6e2306d436
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,10 @@
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):

View file

@ -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;