[Bug 578933] Need generic "deep-element-added" signal and/or playbin "element-setup" signal

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sun May 15 15:48:31 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=578933

--- Comment #30 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
> You can also get RESYNC which is not really a problem and
> you just iterate again

Yes, this is handled two lines below those lines you quoted, the while()
repeats if we get a RESYNC, but we need to clear the list if we get a RESYNC
(or ERROR) otherwise we get duplicate entries in the list.


> @@ +1146,3 @@
> +      GstElement *e;
> +
> +      while ((e = g_queue_pop_head (&elements))) {
> 
> Why don't you just emit in the foreach function? No lock is taken (which is
> why you can get RESYNC).

Because then in case of RESYNC we start over and would possibly emit the signal
multiple times for the same element, which is not nice. Or obsolete elements.
Unless we keep track of the already-emitted elements in a list, which we could
also do I suppose (has the advantage that we don't need to put a ref in the
list and can just check pointer values).

Doing it the way it is now has the advantage that you are guaranteed to emit
the signals for a specific snapshot of the elements at one point in time. Any
other way and it might be a mix of old and new I think.

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