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_foreach() and gst_iterator_find_custom() operations.

The fold will proceed as long as @func returns %TRUE. When the iterator has no more arguments, %GST_ITERATOR_DONE will be returned. If @func returns %FALSE, the fold will stop, and %GST_ITERATOR_OK will be returned. Errors or resyncs will cause fold to return %GST_ITERATOR_ERROR or %GST_ITERATOR_RESYNC as appropriate.

The iterator will not be freed.

Parameters

func GstIteratorFoldFunction

the fold function

ret Value

the seed value passed to the fold function

userData void*

user data passed to the fold function

Return Value

A #GstIteratorResult, as described above.

MT safe.

Meta