Iterator


Object Hierarchy:

Gst.Iterator Gst.Iterator Gst.Iterator

Description:

[ CCode ( copy_function = "gst_iterator_copy" , free_function = "gst_iterator_free" , type_id = "gst_iterator_get_type ()" ) ]
[ Compact ]
public class 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.

Note that if calling a GstIterator function results in your code receiving a refcounted object (with, say, 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:

  GstIterator *it = _get_iterator(object);
GValue item = G_VALUE_INIT;
done = FALSE;
while (!done) {
switch (gst_iterator_next (it, &item)) {
case GST_ITERATOR_OK:
...get/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);


Namespace: Gst
Package: gstreamer-1.0

Content:

Creation methods:

Methods:

Fields: