+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):
* 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;
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
*
void
gst_collect_pads_start (GstCollectPads * pads)
{
+ GSList *collected;
+
g_return_if_fail (pads != NULL);
g_return_if_fail (GST_IS_COLLECT_PADS (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;
/* 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;