Add GBM_CFLAGS and define EGL_PLATFORM_GBM_MESA
authorNorbert Wesp <n.wesp@phytec.de>
Wed, 1 Aug 2018 11:59:45 +0000 (13:59 +0200)
committerMatthew Waters <matthew@centricular.com>
Thu, 2 Aug 2018 02:17:56 +0000 (12:17 +1000)
Building an image with yocto for an 'am335x' processor will fail,
because 'gbm.h' can not be found and 'EGL_PLATFORM_GBM_MESA' is not defined.

So simply adding define of 'EGL_PLATFORM_GBM_MESA' in 'gstgldisplay_egl.c'
and adding 'GBM_CFLAGS' in 'gst-gl.m4' to get rid of this errors and complete
a full build process.

ERRORs were:
-----------
gst-plugins-base-1.14.1/gst-libs/gst/gl/gbm/gstglwindow_gbm_egl.h:24:10:
fatal error: gbm.h: No such file or directory
  #include <gbm.h>
           ^~~~~~~

gst-plugins-base-1.14.1/gst-libs/gst/gl/egl/gstgldisplay_egl.c:157:39:
error: 'EGL_PLATFORM_GBM_MESA' undeclared (first use in this function);
did you mean 'EGL_PLATFORM_WAYLAND'?
  ret = _gst_eglGetPlatformDisplay (EGL_PLATFORM_GBM_MESA, (gpointer) display,
                                    ^~~~~~~~~~~~~~~~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=796885

gst-libs/gst/gl/egl/gstgldisplay_egl.c
m4/gst-gl.m4

index fb329ed..af06351 100644 (file)
@@ -39,6 +39,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
 #ifndef EGL_PLATFORM_WAYLAND
 #define EGL_PLATFORM_WAYLAND 0x31D8
 #endif
+#ifndef EGL_PLATFORM_GBM_MESA
+#define EGL_PLATFORM_GBM_MESA 0x31D7
+#endif
 #ifndef EGL_PLATFORM_ANDROID
 #define EGL_PLATFORM_ANDROID 0x3141
 #endif
index ceb7dc9..7bbc2be 100644 (file)
@@ -528,7 +528,7 @@ case $host in
         AC_MSG_WARN([EGL is required by the Mesa GBM EGL backend])
       else
         HAVE_WINDOW_GBM=yes
-        GL_CFLAGS="$GL_CFLAGS $DRM_CFLAGS"
+        GL_CFLAGS="$GL_CFLAGS $DRM_CFLAGS $GBM_CFLAGS"
       fi
     fi