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 745730 - gl: Putting GstGLAllocator as first allocator in ALLOCATION query
gl: Putting GstGLAllocator as first allocator in ALLOCATION query
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-06 10:27 UTC by Sebastian Dröge (slomo)
Modified: 2016-11-15 03:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2015-03-06 10:27:01 UTC
Currently GL elements are putting the GstGLAllocator as the first allocator in the ALLOCATION query. As long as the caps contain the GL caps feature that is completely ok, but otherwise not.

What can happen otherwise is that the GL allocator is tried to be set on a GstVideoBufferPool or GstBufferPool, which then completely fails because GstGLAllocator can't use the normal GstAllocator::alloc() function.

For sysmem caps, only allocators that work normally should be at the first position.
Comment 1 Sebastian Dröge (slomo) 2015-03-06 10:31:19 UTC
Situation here is the following:
- glvideomixer configures its pool, min-buffers=0
- videotestsrc gets this pool and a corresponding allocator from the allocation query
- videotestsrc tries to change the pool config (and deactivates the pool used by glvideomixer!), setting min-buffers=1. That fails because there is still one outstanding buffer
- basesrc falls back to create a GstBufferPool and tries to use the GstGLAllocator on that
- fails to allocate buffers when starting the new pool


It also seems dangerous that glvideomixer provides its own pool to upstream. Its own pool can already be configured, and upstream might want to configure it differently. Especially all upstreams might want to configure it differently!
Comment 2 Sebastian Dröge (slomo) 2015-03-06 10:37:58 UTC
IMHO the way how pool sharing is implemented in glvideomixer does not make sense as is. There must be a different pool for every upstream as they might have different settings and would trip on each other otherwise.
Comment 3 Nicolas Dufresne (ndufresne) 2015-03-06 12:54:23 UTC
Also seen by me, can't remember what pipeline would trigger this.(In reply to Sebastian Dröge (slomo) from comment #2)

> IMHO the way how pool sharing is implemented in glvideomixer does not make
> sense as is. There must be a different pool for every upstream as they might
> have different settings and would trip on each other otherwise.

Ok, I have patches that rewrite this pool sharing in another bug. I can remove the pool cache if you think it's preferred. Though, I only fixed it since I could not find a valid scenrio to make it break.

https://bugzilla.gnome.org/show_bug.cgi?id=745705
Comment 4 Sebastian Dröge (slomo) 2015-03-06 13:20:14 UTC
That looks very related, but you didn't touch glvideomixer/glmixer :)
Comment 5 Sebastian Dröge (slomo) 2015-03-06 13:49:47 UTC
Workaround is btw to drop all ALLOCATION queries on the sinkpads of glvideomixer via a pad probe
Comment 6 Sebastian Dröge (slomo) 2015-03-07 09:39:14 UTC
The main part of this is fixed by bug #745705 now. What remains is that it's not a good idea to put the GL allocator into the beginning of the allocation query for sysmem caps because of the beforementioned reasons. Less critical now as it would only cause problems in special situations or error cases :)
Comment 7 Matthew Waters (ystreet00) 2016-11-15 03:46:52 UTC
This doens't seem like a problem anymore :)

https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglupload.c?id=dcc7ab25f3e6771fc15d44fc90fc4b2bde9f95d4#n321

Closing.