Gst.Iterator.prototype.fold

function fold(func:Gst.IteratorFoldFunction, ret:GObject.Value):Gst.IteratorResult {
    // Gjs wrapper for gst_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.foreach and Gst.Iterator.prototype.find_custom operations.

The fold will proceed as long as func returns TRUE. When the iterator has no more arguments, Gst.IteratorResult.done will be returned. If func returns FALSE, the fold will stop, and Gst.IteratorResult.ok will be returned. Errors or resyncs will cause fold to return Gst.IteratorResult.error or Gst.IteratorResult.resync as appropriate.

The iterator will not be freed.

func

the fold function

ret

the seed value passed to the fold function

Returns

A Gst.IteratorResult, as described above. MT safe.