gstreamer-vaapi cannot be built without X11 with recent mesa
Describe your issue
mesa 22.3.0 has updated egl headers. eglplatform.h now contains this commit https://github.com/KhronosGroup/EGL-Registry/pull/130/commits/3670d645f4a26a0a9e87e7f3a8608e7cc1d53b5b xlib headers don't get included by default anymore but are dependent upon whether USE_X11 was defined:
'elif defined(USE_X11)'
The same variable gets defined in meson.build and no matter if its value is 'true' or 'false' it triggers eglplatform.h to include the xlib headers.
Expected Behavior
gstreamer-vaapi is buildable without x11.
Observed Behavior
| In file included from /home/pokybuild/yocto-worker/no-x11/build/build/tmp/work/core2-64-poky-linux/gstreamer1.0-vaapi/1.20.4-r0/recipe-sysroot/usr/include/EGL/egl.h:20, | from ../gstreamer-vaapi-1.20.4/gst-libs/gst/vaapi/gstvaapidisplay_egl.h:26, | from ../gstreamer-vaapi-1.20.4/gst-libs/gst/vaapi/gstvaapidisplay_egl.c:24: | /home/pokybuild/yocto-worker/no-x11/build/build/tmp/work/core2-64-poky-linux/gstreamer1.0-vaapi/1.20.4-r0/recipe-sysroot/usr/include/EGL/eglplatform.h:109:10: fatal error: X11/Xlib.h: No such file or directory | 109 | #include <X11/Xlib.h>
Setup
- Yocto/Openembedded
- GStreamer Version: 1.20.4
Solutions you have tried
Renaming USE_X11 to HAVE_X11 in the gstreamer code using sed resolved the issue.