GNOME Bugzilla – Bug 759679
gl: unused function '_get_plane_width'
Last modified: 2016-01-06 05:51:57 UTC
While building gst-plugins-bad on FreeBSD with clang 3.4.1, the following error happend. gmake[5]: Leaving directory '/usr/home/gst/gst/head/gst-plugins-bad/gst-libs/gst/gl/egl' gmake[5]: Entering directory '/usr/home/gst/gst/head/gst-plugins-bad/gst-libs/gst/gl' CC libgstgl_1.0_la-gstgldisplay.lo CC libgstgl_1.0_la-gstglcontext.lo CC libgstgl_1.0_la-gstgldebug.lo CC libgstgl_1.0_la-gstglbasememory.lo CC libgstgl_1.0_la-gstglbuffer.lo CC libgstgl_1.0_la-gstglmemory.lo CC libgstgl_1.0_la-gstglmemorypbo.lo gstglmemorypbo.c:123:1: error: unused function '_get_plane_width' [-Werror,-Wunused-function] _get_plane_width (GstVideoInfo * info, guint plane) ^ 1 error generated. Makefile:1154: recipe for target 'libgstgl_1.0_la-gstglmemorypbo.lo' failed gmake[5]: *** [libgstgl_1.0_la-gstglmemorypbo.lo] Error 1 gmake[5]: Leaving directory '/usr/home/gst/gst/head/gst-plugins-bad/gst-libs/gst/gl' Makefile:1383: recipe for target 'all-recursive' failed
I wonder why gcc 5.3 does not complain about that. Probably because of the inline. Matthew, is it intentionally not used currently? I see that tex_width is used together with the height variant of that function. Should that be changed over to the macro+inline function? Or should those be changed over to return tex_width maybe?
commit c4e5423f3b6cc346dd14f52f6a982e17cf932d12 Author: Sebastian Dröge <sebastian@centricular.com> Date: Wed Dec 23 09:50:13 2015 +0100 glmemorypbo: Comment out unused functions to fix compilation with clang It's not clear if these are intentionally unused or the code should be changed, but this fixes compilation for the time being at least. See https://bugzilla.gnome.org/show_bug.cgi?id=759679
So the difference between tex_width and GL_MEM_WIDTH() is to do with data transfers. The only case where the two values are different is when running on gles2 and (with a non power of two stride or when stride - width * n_components is > 8). The associated texture_scaling[2] transforms between the two values. GL_MEM_WIDTH() is the width that is viewable in the texture. tex_width is the actual width of the texture. So for glmemorypbo as all the occurrences of width are only dealing with the width for data transfer, GL_MEM_WIDTH() is not needed. Even in glmemory, GL_MEM_WIDTH() is only used to initialize tex_width.
So should we remove it or redefine it to just use tex_width here? The code using GL_MEM_HEIGHT() and not GL_MEM_WIDTH() looks a bit weird to me :)
Matthew?
commit 8d34c918551964d4f9d98b9c1af03bc00286f3f7 Author: Matthew Waters <matthew@centricular.com> Date: Wed Jan 6 15:44:52 2016 +1100 glmemorypbo: remove unused code https://bugzilla.gnome.org/show_bug.cgi?id=759679