Gst.Iterator
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.
In general, whenever calling a GstIterator function results in your code receiving a refcounted object, the refcount for that object will have been increased. Your code is responsible for unrefing that object after use.
The basic use pattern of an iterator is as follows:
<example> <title>Using an iterator</title> <programlisting> it = _get_iterator(object); done = FALSE; while (!done) { switch (gst_iterator_next (it, &item)) { case GST_ITERATOR_OK: ... use/change item here... g_value_reset (&item); break; case GST_ITERATOR_RESYNC: ...rollback changes to items... gst_iterator_resync (it); break; case GST_ITERATOR_ERROR: ...wrong parameters were given... done = TRUE; break; case GST_ITERATOR_DONE: done = TRUE; break; } } g_value_unset (&item); gst_iterator_free (it); </programlisting> </example>
Last reviewed on 2009-06-16 (0.10.24)