After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 610366 - [gstcollectpads][doc] Add a reminder for 'data' doc
[gstcollectpads][doc] Add a reminder for 'data' doc
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-18 14:53 UTC by Thiago Sousa Santos
Modified: 2010-08-12 19:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improves the docs (950 bytes, patch)
2010-02-18 14:53 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2010-02-18 14:53:22 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.
Comment 1 Thiago Sousa Santos 2010-02-18 20:04:52 UTC
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
Comment 2 Thiago Sousa Santos 2010-02-19 19:25:45 UTC
matroskamux also relies on the collectpads 'data' iteration.
Comment 3 Sebastian Dröge (slomo) 2010-02-19 19:32:19 UTC
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?
Comment 4 Thiago Sousa Santos 2010-02-19 19:57:15 UTC
(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.
Comment 5 Mark Nauwelaerts 2010-02-22 11:23:17 UTC
Or perhaps use GstCollectPads2 :)

IIRC, it has been arranged there that the 'data' list is more 'reliable' (give or take accessing it appropriately locked).
Comment 6 Sebastian Dröge (slomo) 2010-02-22 19:51:37 UTC
Yes, so let's update that doc comment and then get GstCollectPads2 committed in the next release(s) ;)
Comment 7 Thiago Sousa Santos 2010-02-22 19:53:31 UTC
Agreed.

I have a patch to make qtmux use it somewhere, could be our experimental case :)
Comment 8 Sebastian Dröge (slomo) 2010-02-22 19:58:09 UTC
Mark has patches for many other muxers too btw ;)
Comment 9 Tobias Mueller 2010-08-06 11:54:24 UTC
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.
Comment 10 Thiago Sousa Santos 2010-08-12 19:19:56 UTC
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