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 795336 - egl: build fails using RPi implementation of EGL
egl: build fails using RPi implementation of EGL
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-04-17 17:21 UTC by Omar Akkila
Modified: 2018-04-23 18:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
egl: fix build when using RPi EGL (729 bytes, patch)
2018-04-17 17:22 UTC, Omar Akkila
none Details | Review
egl: fix build when using RPi EGL (784 bytes, patch)
2018-04-18 14:30 UTC, Omar Akkila
committed Details | Review

Description Omar Akkila 2018-04-17 17:21:14 UTC
When building gst-plugins-base using the RPi's implementation of EGL (normally found in /opt/vc), the following occurs:

gsteglimage.c: In function 'gst_egl_image_export_dmabuf':
gsteglimage.c:479:7: error: unknown type name 'EGLuint64KHR'
       EGLuint64KHR * modifiers);
       ^~~~~~~~~~~~
gsteglimage.c:489:3: error: 'gst_eglExportDMABUFImageQueryMESA' undeclared (first use in this function)
   gst_eglExportDMABUFImageQueryMESA =
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gsteglimage.c:489:3: note: each undeclared identifier is reported only once for each function it appears in
gsteglimage.c:512:8: warning: implicit declaration of function 'gst_eglExportDMABUFImageQueryMESA' [-Wimplicit-function-declaration]
   if (!gst_eglExportDMABUFImageQueryMESA (egl_display, image->image,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gsteglimage.c:512:3: warning: nested extern declaration of 'gst_eglExportDMABUFImageQueryMESA' [-Wnested-externs]
   if (!gst_eglExportDMABUFImageQueryMESA (egl_display, image->image,

(The first error causes the following errors and warnings)

This is because EGLuint64KHR is not defined in RPi EGL. Since EGLuint64KHR is a typedef alias for khronos_uint64_t and USE_EGL_RPI is defined when using RPi EGL, we can just typedef it in gst-libs/gst/gl/egl/gstegl.h.
Comment 1 Omar Akkila 2018-04-17 17:22:31 UTC
Created attachment 371065 [details] [review]
egl: fix build when using RPi EGL
Comment 2 Olivier Crête 2018-04-17 17:47:48 UTC
Review of attachment 371065 [details] [review]:

::: gst-libs/gst/gl/egl/gstegl.h
@@ +53,3 @@
 #endif
 
+#if USE_EGL_RPI

use #ifdef otherwise you get a warning on non-RPi platforms
Comment 3 Tim-Philipp Müller 2018-04-17 17:54:37 UTC
Comment on attachment 371065 [details] [review]
egl: fix build when using RPi EGL

>+++ b/gst-libs/gst/gl/egl/gstegl.h
> 
>+#if USE_EGL_RPI
>+typedef khronos_uint64_t EGLuint64KHR;
>+#endif
>+

This is an installed header, but USE_EGL_RPI will only be defined if compiling gst-gl itself, so will this not cause problems when compiling external things that use this header?
Comment 4 Omar Akkila 2018-04-18 14:14:31 UTC
> This is an installed header, but USE_EGL_RPI will only be defined if
> compiling gst-gl itself, so will this not cause problems when compiling
> external things that use this header?

That is true. What we can do instead is move those lines to gsteglimage.c since the only instance of EGLuint64KHR being used is in that file.
Comment 5 Omar Akkila 2018-04-18 14:30:08 UTC
Created attachment 371092 [details] [review]
egl: fix build when using RPi EGL
Comment 6 Olivier Crête 2018-04-18 18:37:50 UTC
Attachment 371092 [details] pushed as 2f3ff84 - egl: fix build when using RPi EGL