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 * Various GStreamer objects provide access to their internal structures using
* an iterator. * an iterator.
* *
* In general, whenever calling a GstIterator function results in your code * Note that if calling a GstIterator function results in your code receiving
* receiving a refcounted object, the refcount for that object will have been * a refcounted object (with, say, g_value_get_object()), the refcount for that
* increased. Your code is responsible for unreffing that object after use. * 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: * The basic use pattern of an iterator is as follows:
* |[ * |[
* GstIterator *it = _get_iterator(object); * GstIterator *it = _get_iterator(object);
* GValue item = G_VALUE_INIT;
* done = FALSE; * done = FALSE;
* while (!done) { * while (!done) {
* switch (gst_iterator_next (it, &item)) { * switch (gst_iterator_next (it, &item)) {
* case GST_ITERATOR_OK: * case GST_ITERATOR_OK:
* ... use/change item here... * ...get/use/change item here...
* g_value_reset (&item); * g_value_reset (&item);
* break; * break;
* case GST_ITERATOR_RESYNC: * case GST_ITERATOR_RESYNC: