[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 07:22:09 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=742152
  GStreamer | gstreamer (core) | git

--- Comment #2 from Thibault Saunier <tsaunier at gnome.org> 2014-12-31 15:22:05 UTC ---
> It's kind of a middle way. The alternative is to add callback-based variants of
> all the various _iterate*() functions.

Right, I think it is a good option, something like:

Why not just do:

gst_element_iterate_*pads_once (GstElement *element,
    GstPadForeachFunction func, gpointer udata);

gst_bin_iterate_*_once (GstBin *bin,
    GstElementForeachFunction func, gpointer udata);

> 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.

Could be too.

-- 
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