From c3cea0238ef986b424e2ec250b7ba531260b9bf0 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 31 Jan 2021 21:42:56 -0600 Subject: [PATCH] Fix build with old EGL 1.5 headers without EGL_EGL_PROTOTYPES --- app/streaming/video/ffmpeg-renderers/eglvid.cpp | 12 ------------ app/streaming/video/ffmpeg-renderers/renderer.h | 16 +++++++++++----- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/eglvid.cpp b/app/streaming/video/ffmpeg-renderers/eglvid.cpp index 84f726c0..4b687abd 100644 --- a/app/streaming/video/ffmpeg-renderers/eglvid.cpp +++ b/app/streaming/video/ffmpeg-renderers/eglvid.cpp @@ -15,18 +15,6 @@ #include #include -#ifndef EGL_VERSION_1_5 -typedef intptr_t EGLAttrib; -#endif - -#if !defined(EGL_VERSION_1_5) || !defined(EGL_EGL_PROTOTYPES) -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); -#endif - -#ifndef EGL_EXT_platform_base -typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); -#endif - // These are EGL extensions, so some platform headers may not provide them #ifndef EGL_PLATFORM_WAYLAND_KHR #define EGL_PLATFORM_WAYLAND_KHR 0x31D8 diff --git a/app/streaming/video/ffmpeg-renderers/renderer.h b/app/streaming/video/ffmpeg-renderers/renderer.h index 5fc0f66c..1fb048e2 100644 --- a/app/streaming/video/ffmpeg-renderers/renderer.h +++ b/app/streaming/video/ffmpeg-renderers/renderer.h @@ -9,7 +9,6 @@ extern "C" { #include } -#ifdef HAVE_EGL #ifdef HAVE_EGL #define MESA_EGL_NO_X11_HEADERS #define EGL_NO_X11 @@ -18,17 +17,25 @@ extern "C" { #ifndef EGL_VERSION_1_5 typedef intptr_t EGLAttrib; typedef void *EGLImage; -typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); #endif -#ifndef EGL_KHR_image +#if !defined(EGL_VERSION_1_5) || !defined(EGL_EGL_PROTOTYPES) +typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); +#endif + +#if !defined(EGL_KHR_image) || !defined(EGL_EGLEXT_PROTOTYPES) // EGL_KHR_image technically uses EGLImageKHR instead of EGLImage, but they're compatible // so we swap them here to avoid mixing them all over the place typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImage image); #endif +#if !defined(EGL_EXT_platform_base) || !defined(EGL_EGLEXT_PROTOTYPES) +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); +#endif + #ifndef EGL_EXT_image_dma_buf_import #define EGL_LINUX_DMA_BUF_EXT 0x3270 #define EGL_LINUX_DRM_FOURCC_EXT 0x3271 @@ -43,7 +50,6 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL #endif #define EGL_MAX_PLANES 4 -#endif class EGLExtensions { public: