mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
API: gst_collect_pads_set_flushing
Original commit message from CVS: * docs/libs/gstreamer-libs-sections.txt: * libs/gst/base/gstcollectpads.c: (gst_collect_pads_set_flushing_unlocked), (gst_collect_pads_set_flushing), (gst_collect_pads_start), (gst_collect_pads_stop): * libs/gst/base/gstcollectpads.h: API: gst_collect_pads_set_flushing Added api to set the pads to flushing, usefull for seeking code in elements using collectpads. Clear segment when receiving a flush.
This commit is contained in:
parent
1c30940f57
commit
506118081e
4 changed files with 56 additions and 3 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2006-05-29 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* docs/libs/gstreamer-libs-sections.txt:
|
||||
* libs/gst/base/gstcollectpads.c:
|
||||
(gst_collect_pads_set_flushing_unlocked),
|
||||
(gst_collect_pads_set_flushing), (gst_collect_pads_start),
|
||||
(gst_collect_pads_stop):
|
||||
* libs/gst/base/gstcollectpads.h:
|
||||
API: gst_collect_pads_set_flushing
|
||||
Added api to set the pads to flushing, usefull for seeking
|
||||
code in elements using collectpads.
|
||||
Clear segment when receiving a flush.
|
||||
|
||||
2006-05-29 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/gst.c: (add_path_func), (init_post):
|
||||
|
|
|
@ -233,6 +233,7 @@ gst_collect_pads_collect
|
|||
gst_collect_pads_collect_range
|
||||
gst_collect_pads_start
|
||||
gst_collect_pads_stop
|
||||
gst_collect_pads_set_flushing
|
||||
gst_collect_pads_peek
|
||||
gst_collect_pads_pop
|
||||
gst_collect_pads_available
|
||||
|
|
|
@ -395,7 +395,8 @@ gst_collect_pads_collect_range (GstCollectPads * pads, guint64 offset,
|
|||
* Must be called with PAD_LOCK.
|
||||
*/
|
||||
static void
|
||||
gst_collect_pads_set_flushing (GstCollectPads * pads, gboolean flushing)
|
||||
gst_collect_pads_set_flushing_unlocked (GstCollectPads * pads,
|
||||
gboolean flushing)
|
||||
{
|
||||
GSList *walk = NULL;
|
||||
|
||||
|
@ -409,11 +410,36 @@ gst_collect_pads_set_flushing (GstCollectPads * pads, gboolean flushing)
|
|||
GST_PAD_SET_FLUSHING (cdata->pad);
|
||||
else
|
||||
GST_PAD_UNSET_FLUSHING (cdata->pad);
|
||||
cdata->abidata.ABI.flushing = flushing;
|
||||
GST_OBJECT_UNLOCK (cdata->pad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_collect_pads_set_flushing:
|
||||
* @pads: the collectspads to use
|
||||
* @flushing: desired state of the pads
|
||||
*
|
||||
* Change the flushing state of all the pads in the collection. No pad
|
||||
* is able to accept anymore data when @flushing is %TRUE. Calling this
|
||||
* function with @flushing %TRUE makes @pads accept data again.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
* Since: 0.10.7.
|
||||
*/
|
||||
void
|
||||
gst_collect_pads_set_flushing (GstCollectPads * pads, gboolean flushing)
|
||||
{
|
||||
g_return_if_fail (pads != NULL);
|
||||
g_return_if_fail (GST_IS_COLLECT_PADS (pads));
|
||||
|
||||
GST_COLLECT_PADS_PAD_LOCK (pads);
|
||||
gst_collect_pads_set_flushing_unlocked (pads, flushing);
|
||||
GST_COLLECT_PADS_PAD_UNLOCK (pads);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_collect_pads_start:
|
||||
* @pads: the collectspads to use
|
||||
|
@ -425,6 +451,8 @@ gst_collect_pads_set_flushing (GstCollectPads * pads, gboolean flushing)
|
|||
void
|
||||
gst_collect_pads_start (GstCollectPads * pads)
|
||||
{
|
||||
GSList *collected;
|
||||
|
||||
g_return_if_fail (pads != NULL);
|
||||
g_return_if_fail (GST_IS_COLLECT_PADS (pads));
|
||||
|
||||
|
@ -435,7 +463,17 @@ gst_collect_pads_start (GstCollectPads * pads)
|
|||
|
||||
/* make pads streamable */
|
||||
GST_COLLECT_PADS_PAD_LOCK (pads);
|
||||
gst_collect_pads_set_flushing (pads, FALSE);
|
||||
|
||||
/* loop over the master pad list and reset the segment */
|
||||
collected = pads->abidata.ABI.pad_list;
|
||||
for (; collected; collected = g_slist_next (collected)) {
|
||||
GstCollectData *data;
|
||||
|
||||
data = collected->data;
|
||||
gst_segment_init (&data->segment, GST_FORMAT_UNDEFINED);
|
||||
}
|
||||
|
||||
gst_collect_pads_set_flushing_unlocked (pads, FALSE);
|
||||
|
||||
/* Start collect pads */
|
||||
pads->started = TRUE;
|
||||
|
@ -467,7 +505,7 @@ gst_collect_pads_stop (GstCollectPads * pads)
|
|||
|
||||
/* make pads not accept data anymore */
|
||||
GST_COLLECT_PADS_PAD_LOCK (pads);
|
||||
gst_collect_pads_set_flushing (pads, TRUE);
|
||||
gst_collect_pads_set_flushing_unlocked (pads, TRUE);
|
||||
|
||||
/* Stop collect pads */
|
||||
pads->started = FALSE;
|
||||
|
|
|
@ -157,6 +157,7 @@ GstFlowReturn gst_collect_pads_collect_range (GstCollectPads *pads, guint64 off
|
|||
|
||||
void gst_collect_pads_start (GstCollectPads *pads);
|
||||
void gst_collect_pads_stop (GstCollectPads *pads);
|
||||
void gst_collect_pads_set_flushing (GstCollectPads *pads, gboolean flushing);
|
||||
|
||||
/* get collected buffers */
|
||||
GstBuffer* gst_collect_pads_peek (GstCollectPads *pads, GstCollectData *data);
|
||||
|
|
Loading…
Reference in a new issue