[Bug 742152] iterator: Add a way to iterate pads and elements only once for each
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Wed Dec 31 06:24:55 PST 2014
https://bugzilla.gnome.org/show_bug.cgi?id=742152
GStreamer | gstreamer (core) | git
Tim-Philipp Müller <t.i.m> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
CC| |t.i.m at zen.co.uk
Version|1.x |git
Ever Confirmed|0 |1
Severity|normal |enhancement
--- Comment #1 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2014-12-31 14:24:49 UTC ---
Maybe my suggestion is not ideal, since you would still have to do:
iterator = gst_element_iterate_sink_pads()
gst_iterator_once_foreach_pad (iterator, callback_func, data);
gst_iterator_free (iterator);
It's kind of a middle way. The alternative is to add callback-based variants of
all the various _iterate*() functions.
OR, and at least from a C language point of view this might be a bit
nicer/tighter (since we have no lambda funcs there):
iterator = gst_element_iterate_sink_pads()
while ((pad = gst_iterator_iterate_once_get_next_pad (iterator))) {
do_xyz...
}
gst_iterator_free (iterator);
as it seems to me that almost all callback functions are basically 1-3 lines of
code anyway.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list