iterator: Fix outdated example code and accompanying documentation

GstIterator no longer returns a refcounted gpointer
This commit is contained in:
Nirbheek Chauhan 2014-12-27 15:15:30 +05:30 committed by Tim-Philipp Müller
parent bc1ec4ec5f
commit b627201e7e

View file

@ -32,18 +32,20 @@
* 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 unreffing that object after use.
* 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:
* |[
* GstIterator *it = _get_iterator(object);
* GValue item = G_VALUE_INIT;
* done = FALSE;
* while (!done) {
* switch (gst_iterator_next (it, &item)) {
* case GST_ITERATOR_OK:
* ... use/change item here...
* ...get/use/change item here...
* g_value_reset (&item);
* break;
* case GST_ITERATOR_RESYNC: