Static$gtypeCreate a new iterator from an existing iterator. The new iterator
will only return those elements that match the given compare function func.
The first parameter that is passed to func is the GObject.Value of the current
iterator element and the second parameter is user_data. func should
return 0 for elements that should be included in the filtered iterator.
When this iterator is freed, it will also be freed.
the compare function to select elements
user data passed to the compare function
a new Gst.Iterator. MT safe.
Find the first element in it that matches the compare function func.
func should return 0 when the element is found. The first parameter
to func will be the current element of the iterator and the
second parameter will be user_data.
The result will be stored in elem if a result is found.
The iterator will not be freed.
This function will return false if an error happened to the iterator
or if the element wasn't found.
the compare function to use
Returns true if the element was found, else false. MT safe.
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.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.
the fold function
the seed value passed to the fold function
A Gst.IteratorResult, as described above. MT safe.
Iterate over all element of it and call the given function func for
each element.
the function to call for each element.
the result call to gst_iterator_fold(). The iterator will not be freed. MT safe.
Free the iterator.
MT safe.
Get the next item from the iterator in elem.
Only when this function returns Gst.IteratorResult.OK, elem will contain a valid
value. elem must have been initialized to the type of the iterator or
initialized to zeroes with g_value_unset(). The caller is responsible for
unsetting or resetting elem with g_value_unset() or g_value_reset()
after usage.
When this function returns Gst.IteratorResult.DONE, no more elements can be
retrieved from it.
A return value of Gst.IteratorResult.RESYNC indicates that the element list was
concurrently updated. The user of it should call gst_iterator_resync() to
get the newly updated list.
A return value of Gst.IteratorResult.ERROR indicates an unrecoverable fatal error.
The result of the iteration. Unset elem after usage. MT safe.
Pushes other iterator onto it. All calls performed on it are
forwarded to other. If other returns Gst.IteratorResult.DONE, it is
popped again and calls are handled by it again.
This function is mainly used by objects implementing the iterator next function to recurse into substructures.
When gst_iterator_resync() is called on it, other will automatically be
popped.
MT safe.
The Gst.Iterator to push
Resync the iterator. this function is mostly called
after gst_iterator_next() returned Gst.IteratorResult.RESYNC.
When an iterator was pushed on it, it will automatically be popped again
with this function.
MT safe.
Staticnew_
A GstIterator is used to retrieve multiple objects from another object in a threadsafe way.
Various GStreamer objects provide access to their internal structures using an iterator.
Note that if calling a GstIterator function results in your code receiving a refcounted object (with, say,
g_value_get_object()), the refcount for that object will not be increased. Your code is responsible for taking a reference if it wants to continue using it later.The basic use pattern of an iterator is as follows: