result = gst_iterator_next (it, &item);
switch (result) {
case GST_ITERATOR_OK:
- /* FIXME: is there a way to ref/unref items? */
if (!func (item, ret, user_data))
goto fold_done;
else
}
}
+/* FIXME 0.11:
+ * We should store ref/unref (or copy/free) functions for the type
+ * in GstIterator. The unref but only if it's not a match behaviour
+ * of find_custom() is very bad for bindings. The ref/unref functions
+ * are also useful for the fold and filter cases.
+ */
+
/**
* gst_iterator_find_custom:
* @it: The #GstIterator to iterate
* Find the first element in @it that matches the compare function @func.
* @func should return 0 when the element is found. As in gst_iterator_fold(),
* the refcount of a refcounted object will be increased before @func is
- * called, and should be unrefed after use.
+ * called, and should be unrefed after use in @func unless it is the matching
+ * element.
*
* The iterator will not be freed.
*