raspberry pi build needs to detect and use brcmegl / brcmglesv2
Building git master on the rpi fails with the following:
[608/2446] Compiling C object 'subprojects/gst-plugins-base/gst-libs/gst/gl/d6e11d2@@gstgl-1.0@sha/egl_gsteglimage.c.o'.
FAILED: subprojects/gst-plugins-base/gst-libs/gst/gl/d6e11d2@@gstgl-1.0@sha/egl_gsteglimage.c.o
cc -Isubprojects/gst-plugins-base/gst-libs/gst/gl/d6e11d2@@gstgl-1.0@sha -Isubprojects/gst-plugins-base/gst-libs/gst/gl -I../subprojects/gst-plugins-base/gst-libs/gst/gl -Isubprojects/gst-plugins-base -I../subprojects/gst-plugins-base -Isubprojects/gst-plugins-base/gst-libs -I../subprojects/gst-plugins-base/gst-libs -I../subprojects/gl-headers/glext -I../subprojects/gl-headers/abyss -I../subprojects/gl-headers/wglext -Isubprojects/gstreamer/libs -I../subprojects/gstreamer/libs -Isubprojects/gstreamer -I../subprojects/gstreamer -Isubprojects/orc -I../subprojects/orc -Isubprojects/gstreamer/gst -Isubprojects/gst-plugins-base/gst-libs/gst/video -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/libdrm -I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -fvisibility=hidden -fno-strict-aliasing -DG_DISABLE_DEPRECATED -Wmissing-declarations -Wredundant-decls -Wundef -Wwrite-strings -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wvla -Wpointer-arith -Wmissing-prototypes -Wdeclaration-after-statement -fPIC -pthread -DUSE_VCHIQ_ARM -DHAVE_CONFIG_H '-DGST_GL_LIBEGL_MODULE_NAME="/opt/vc/lib/libbrcmEGL.so"' '-DGST_GL_LIBGLESV2_MODULE_NAME="/opt/vc/lib/libbrcmGLESv2.so"' -DUSE_EGL_RPI -DBUILDING_GST_GL -MD -MQ 'subprojects/gst-plugins-base/gst-libs/gst/gl/d6e11d2@@gstgl-1.0@sha/egl_gsteglimage.c.o' -MF 'subprojects/gst-plugins-base/gst-libs/gst/gl/d6e11d2@@gstgl-1.0@sha/egl_gsteglimage.c.o.d' -o 'subprojects/gst-plugins-base/gst-libs/gst/gl/d6e11d2@@gstgl-1.0@sha/egl_gsteglimage.c.o' -c ../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c: In function '_gst_egl_image_check_dmabuf_direct':
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:677:3: error: unknown type name 'EGLuint64KHR'
EGLuint64KHR *modifiers;
^~~~~~~~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:686:38: error: unknown type name 'EGLuint64KHR'
int format, int max_modifiers, EGLuint64KHR * modifiers,
^~~~~~~~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:691:3: error: 'gst_eglQueryDmaBufModifiersEXT' undeclared (first use in this function)
gst_eglQueryDmaBufModifiersEXT =
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:691:3: note: each undeclared identifier is reported only once for each function it appears in
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:732:9: warning: implicit declaration of function 'gst_eglQueryDmaBufModifiersEXT' [-Wimplicit-function-declaration]
ret = gst_eglQueryDmaBufModifiersEXT (egl_display, fourcc, 0, NULL, NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib/glist.h:32:0,
from /usr/include/glib-2.0/glib/ghash.h:33,
from /usr/include/glib-2.0/glib.h:50,
from ../subprojects/gstreamer/gst/gst.h:27,
from ../subprojects/gst-plugins-base/gst-libs/gst/gl/gstgl_fwd.h:24,
from ../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.h:26,
from ../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:41:
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:740:22: error: 'EGLuint64KHR' undeclared (first use in this function)
modifiers = g_new (EGLuint64KHR, num_modifiers);
^
/usr/include/glib-2.0/glib/gmem.h:206:3: note: in definition of macro '_G_NEW'
(struct_type *) (G_GNUC_EXTENSION ({ \
^~~~~~~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:740:15: note: in expansion of macro 'g_new'
modifiers = g_new (EGLuint64KHR, num_modifiers);
^~~~~
/usr/include/glib-2.0/glib/gmem.h:206:16: error: expected expression before ')' token
(struct_type *) (G_GNUC_EXTENSION ({ \
^
/usr/include/glib-2.0/glib/gmem.h:261:41: note: in expansion of macro '_G_NEW'
#define g_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc)
^~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:740:15: note: in expansion of macro 'g_new'
modifiers = g_new (EGLuint64KHR, num_modifiers);
^~~~~
/usr/include/glib-2.0/glib/gmem.h:211:22: error: '__n' undeclared (first use in this function)
__p = g_##func (__n); \
^
/usr/include/glib-2.0/glib/gmem.h:261:41: note: in expansion of macro '_G_NEW'
#define g_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc)
^~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:740:15: note: in expansion of macro 'g_new'
modifiers = g_new (EGLuint64KHR, num_modifiers);
^~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c: In function 'gst_egl_image_export_dmabuf':
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:943:7: error: unknown type name 'EGLuint64KHR'
EGLuint64KHR * modifiers);
^~~~~~~~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:953:3: error: 'gst_eglExportDMABUFImageQueryMESA' undeclared (first use in this function)
gst_eglExportDMABUFImageQueryMESA =
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c:976:8: warning: implicit declaration of function 'gst_eglExportDMABUFImageQueryMESA' [-Wimplicit-function-declaration]
if (!gst_eglExportDMABUFImageQueryMESA (egl_display, image->image,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I configured the build with:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/vc/lib/pkgconfig/
meson b -D gst-plugins-base:gl_api=gles2 -D gst-plugins-base:gl_platform=egl -D gst-plugins-base:gl_winsys=dispmanx -D gst-plugins-base:gles2_module_name=/opt/vc/lib/libbrcmGLESv2.so -D gst-plugins-base:egl_module_name=/opt/vc/lib/libbrcmEGL.so -D omx=enabled -D gst-omx:header_path=/opt/vc/include/IL/ -D gst-omx:target=rpi -D python=disabled -D gst-plugins-base:gl_api=gles2 -D gst-plugins-base:gl_platform=egl -D gst-plugins-base:gl_winsys=dispmanx -D introspection=disabled -D gst-plugins-bad:bluez=disabled -D gst-plugins-bad:opencv=disabled
Note that I did install the mesa glesv2 and egl headers, since I couldn't find any way to make meson use the broadcom GLES/EGL from /opt/vc/include