GNOME Bugzilla – Bug 610366
[gstcollectpads][doc] Add a reminder for 'data' doc
Last modified: 2010-08-12 19:19:56 UTC
Created attachment 154139 [details] [review] Improves the docs The public 'data' attribute in collectpads shouldn't be used for iteration (I don't know if it should be used at all) because it doesn't contain the pad list at all times. We should fix that on the docs. Maybe we can also add API for proper collectdata iteration.
Committed the doc fix. Is it worth having API for the iteration? Module: gstreamer Branch: master Commit: 035e5c74bed160d568236961e4c955a946e8ec1f URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=035e5c74bed160d568236961e4c955a946e8ec1f Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Thu Feb 18 11:52:28 2010 -0300 collectpads: Improve docs about 'data' attribute Adds a reminder to 'data' attribute doc Fixes #610366
matroskamux also relies on the collectpads 'data' iteration.
Same goes for mxfmux. It even sorts the collectpads data list ;) What's the correct way for iterating over it? Other than storing your own copy of the list? And why are there not all pads in the last all the time? Can't this be fixed?
(In reply to comment #3) > Same goes for mxfmux. It even sorts the collectpads data list ;) > > What's the correct way for iterating over it? Other than storing your own copy > of the list? I don't think there is a way :( > > And why are there not all pads in the last all the time? Can't this be fixed? If you look at _add_pad_full(), the pads are added to a private list. They are only added to the 'data' list when _check_pads_unlocked() is called. Apparently on the collected function it is safe to iterate them. But I'm having problems in qtmux when trying to iterate them at some other points (like state changes). Perhaps my docs commit should be update to tell people it is safe to iterate on the collected callback.
Or perhaps use GstCollectPads2 :) IIRC, it has been arranged there that the 'data' list is more 'reliable' (give or take accessing it appropriately locked).
Yes, so let's update that doc comment and then get GstCollectPads2 committed in the next release(s) ;)
Agreed. I have a patch to make qtmux use it somewhere, could be our experimental case :)
Mark has patches for many other muxers too btw ;)
Hm. What's the status of this bug? Can it be reopened or closed? The initial question was in comment #1 which I don't see to be answered.
Pushed another docfix, now we can close this. We can open another bug if we decide to start using GstCollectPads2. commit ac9bfe25ae5ec4bccb10dce832c124345fe5294f Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Thu Aug 12 16:05:35 2010 -0300 gstcollectpads: Fix docs about GstCollectData list Add to the docs the fact that is only safe to iterate GstCollectPad's data list inside the collected callback. Fixes #610366