element: add gst_element_foreach_*pad()
authorTim-Philipp Müller <tim@centricular.com>
Tue, 1 Aug 2017 10:06:32 +0000 (11:06 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 2 Nov 2017 15:59:22 +0000 (15:59 +0000)
commitd106390adce5cee837d2d0aab377d758a45a4b2d
treef0f29e2487d4c1df651e0f440089d37eded185cb
parentf911fe43141b8398cbb20e3a7e17b1690a614871
element: add gst_element_foreach_*pad()

Add convenience API that iterates over all pads, sink pads or
source pads and makes sure that the foreach function is called
exactly once for each pad.

This is a KISS implementation. It doesn't use GstIterator and
doesn't try to do clever things like resync if pads are added
or removed while the function is executing. We can still do that
in future if we think it's needed, but in practice it will
likely make absolutely no difference whatsoever, since these
things will have to be handled properly elsewhere by the element
anyway if they're important.

After all, it's always possible that a pad is added or removed
just after the iterator finishes iterating, but before the
function returns.

This is also a replacement for gst_aggregator_iterate_sink_pads().

https://bugzilla.gnome.org/show_bug.cgi?id=785679
docs/gst/gstreamer-sections.txt
gst/gstelement.c
gst/gstelement.h
tests/check/gst/gstelement.c
win32/common/libgstreamer.def