Iterator.fold

Folds func over the elements of iter. That is to say, func will be called as func (object, ret, user_data) for each object in it. The normal use of this procedure is to accumulate the results of operating on the objects in ret.

This procedure can be used (and is used internally) to implement the [gst.iterator.Iterator.foreach_] and [gst.iterator.Iterator.findCustom] operations.

The fold will proceed as long as func returns true. When the iterator has no more arguments, [gst.types.IteratorResult.Done] will be returned. If func returns false, the fold will stop, and [gst.types.IteratorResult.Ok] will be returned. Errors or resyncs will cause fold to return [gst.types.IteratorResult.Error] or [gst.types.IteratorResult.Resync] as appropriate.

The iterator will not be freed.

Parameters

functhe fold function
retthe seed value passed to the fold function

Returns

A #GstIteratorResult, as described above.

MT safe.