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 728815 - GstGLMemory mix stride and width
GstGLMemory mix stride and width
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal blocker
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-23 20:06 UTC by Julien Isorce
Modified: 2014-05-02 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Julien Isorce 2014-04-23 20:06:07 UTC
I have not investigated too much but worth to open a bug before to forget.

So in gst_gl_memory_setup_buffer we use GST_VIDEO_INFO_PLANE_STRIDE (info, i) as the stride param of gst_gl_memory_alloc whereas in gstglupload or gstglconvert we use the width.

And we use this param to compute the maxsize http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglmemory.c#n485

And maxsize is used for g_malloc http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglmemory.c#n896

So when doing gst-launch videotestrc ! video/x-raw, format=RGB ! glimagesink

2 textures are allocated with their glmem maxsize set to 960 (stride), and the texture used for the FBO has its glmem maxsize set to 360.

I tried to replace GST_VIDEO_INFO_PLANE_STRIDE (info, i) by _get_plane_width (info, i) here http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglmemory.c#n1087  and the above pipeline still works.

Another thing is that the texture used for the FBO also has its glmem that does a g_malloc, is it really useful ? maybe for download ? but worth to allocate only if we actually do a download.
Comment 1 Matthew Waters (ystreet00) 2014-04-27 13:20:34 UTC
Yea, needs to be looked at before 1.4

As for download, yes that could be smarter but currently it just works (TM) :).
Comment 2 Matthew Waters (ystreet00) 2014-05-02 06:04:44 UTC
commit 598a79a5e21a03aa59a14e0c5976cf6458b1b373
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Thu May 1 13:57:16 2014 +1000

    gl/mem: implement texture copying between formats with strides properly
    
    Previously, we used the width to determine the amount of data to be
    copied using pbos.  This, makes it allocate enough data for the
    the strides as well.
Comment 3 Sebastian Dröge (slomo) 2014-05-02 07:40:44 UTC
Can this be closed then?