aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/platform/linux/gbm.cmake3
-rw-r--r--cmake/platform/linux/wayland.cmake3
-rw-r--r--cmake/platform/linux/x11.cmake2
-rw-r--r--xbmc/CMakeLists.txt1
-rw-r--r--xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h3
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h9
-rw-r--r--xbmc/system_egl.h51
-rw-r--r--xbmc/utils/EGLFence.h3
-rw-r--r--xbmc/utils/EGLImage.h3
-rw-r--r--xbmc/utils/EGLUtils.h2
-rw-r--r--xbmc/windowing/X11/GLContextEGL.h2
-rw-r--r--xbmc/windowing/X11/WinSystemX11GLContext.h3
-rw-r--r--xbmc/windowing/android/AndroidUtils.cpp2
-rw-r--r--xbmc/windowing/android/WinSystemAndroid.cpp2
-rw-r--r--xbmc/windowing/android/WinSystemAndroid.h3
-rw-r--r--xbmc/windowing/gbm/WinSystemGbm.h1
-rw-r--r--xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp2
-rw-r--r--xbmc/windowing/gbm/WinSystemGbmGLContext.cpp1
-rw-r--r--xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp2
-rw-r--r--xbmc/windowing/gbm/drm/DRMLegacy.cpp1
-rw-r--r--xbmc/windowing/wayland/WinSystemWaylandEGLContext.cpp3
-rw-r--r--xbmc/windowing/wayland/WinSystemWaylandEGLContextGL.cpp1
-rw-r--r--xbmc/windowing/wayland/WinSystemWaylandEGLContextGLES.cpp2
24 files changed, 78 insertions, 33 deletions
diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake
index 75b23f3e2a..fa24fe400d 100644
--- a/cmake/platform/linux/gbm.cmake
+++ b/cmake/platform/linux/gbm.cmake
@@ -13,5 +13,4 @@ else()
message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the GBM windowing system. Please set GBM_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".")
endif()
-# __GBM__ is needed by eglplatform.h in case it is included before gbm.h
-list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11 -D__GBM__=1 -DPLATFORM_SETTINGS_FILE=gbm.xml)
+list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=gbm.xml)
diff --git a/cmake/platform/linux/wayland.cmake b/cmake/platform/linux/wayland.cmake
index 916b578128..7137c93ce7 100644
--- a/cmake/platform/linux/wayland.cmake
+++ b/cmake/platform/linux/wayland.cmake
@@ -15,7 +15,6 @@ endif()
set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols)
set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}")
-# WL_EGL_PLATFORM is needed by eglplatform.h in case it is included before wayland-egl.h
-list(APPEND PLATFORM_DEFINES -DWL_EGL_PLATFORM=1 -DPLATFORM_SETTINGS_FILE=wayland.xml)
+list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=wayland.xml)
# for wayland-extra-protocols.hpp
include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}")
diff --git a/cmake/platform/linux/x11.cmake b/cmake/platform/linux/x11.cmake
index 5d7f3d4039..e3e6042596 100644
--- a/cmake/platform/linux/x11.cmake
+++ b/cmake/platform/linux/x11.cmake
@@ -14,4 +14,4 @@ else()
message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the X11 windowing system. Please set X11_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".")
endif()
-list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=x11.xml) \ No newline at end of file
+list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=x11.xml)
diff --git a/xbmc/CMakeLists.txt b/xbmc/CMakeLists.txt
index a68d1a56a9..77bca5648b 100644
--- a/xbmc/CMakeLists.txt
+++ b/xbmc/CMakeLists.txt
@@ -86,6 +86,7 @@ set(HEADERS AppParamParser.h
XBApplicationEx.h
XBDateTime.h
system.h
+ system_egl.h
system_gl.h)
if(ENABLE_OPTICAL)
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h
index 4dd97af22f..9b16eaa255 100644
--- a/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h
+++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/gl/GLonDX.h
@@ -10,7 +10,8 @@
#ifdef __cplusplus
-#include <EGL/egl.h>
+#include "system_egl.h"
+
#include <EGL/eglext.h>
#include <angle_gl.h>
#include <d3d11.h>
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
index e047f574b0..6e2ffe1cf8 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
@@ -38,11 +38,11 @@ extern "C" {
#include <libavfilter/buffersrc.h>
}
-#include <va/va_vpp.h>
-#include <xf86drm.h>
+#include "system_egl.h"
-#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include <va/va_vpp.h>
+#include <xf86drm.h>
#if VA_CHECK_VERSION(1, 0, 0)
# include <va/va_str.h>
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h
index 0a591a2fdc..66d1bf0200 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VaapiEGL.h
@@ -22,13 +22,14 @@
#include <GLES3/gl3.h>
#endif
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <va/va.h>
-
+#include "system_egl.h"
#include "utils/Geometry.h"
+
#include "platform/posix/utils/FileHandle.h"
+#include <EGL/eglext.h>
+#include <va/va.h>
+
namespace VAAPI
{
diff --git a/xbmc/system_egl.h b/xbmc/system_egl.h
new file mode 100644
index 0000000000..18ef124b59
--- /dev/null
+++ b/xbmc/system_egl.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2005-2020 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#if defined(TARGET_LINUX)
+
+#if defined(WL_EGL_PLATFORM)
+#undef WL_EGL_PLATFORM
+#define KODI_WL_EGL_PLATFORM
+#endif
+
+#if defined(__GBM__)
+#undef __GBM__
+#define KODI__GBM__
+#endif
+
+#if defined(USE_X11)
+#undef USE_X11
+#define KODI_USE_X11
+#endif
+
+#define EGL_NO_X11
+#define MESA_EGL_NO_X11_HEADERS
+#endif
+
+#include <EGL/egl.h>
+
+#if defined(TARGET_LINUX)
+
+#if defined(KODI_WL_EGL_PLATFORM)
+#undef KODI_WL_EGL_PLATFORM
+#define WL_EGL_PLATFORM
+#endif
+
+#if defined(KODI__GBM__)
+#undef KODI__GBM__
+#define __GBM__
+#endif
+
+#if defined(KODI_USE_X11)
+#undef KODI_USE_X11
+#define USE_X11
+#endif
+
+#endif
diff --git a/xbmc/utils/EGLFence.h b/xbmc/utils/EGLFence.h
index 1664772ef0..bd96444e47 100644
--- a/xbmc/utils/EGLFence.h
+++ b/xbmc/utils/EGLFence.h
@@ -8,7 +8,8 @@
#pragma once
-#include <EGL/egl.h>
+#include "system_egl.h"
+
#include <EGL/eglext.h>
namespace KODI
diff --git a/xbmc/utils/EGLImage.h b/xbmc/utils/EGLImage.h
index 33adc92ed5..5e86155571 100644
--- a/xbmc/utils/EGLImage.h
+++ b/xbmc/utils/EGLImage.h
@@ -8,9 +8,10 @@
#pragma once
+#include "system_egl.h"
+
#include <array>
-#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <drm_fourcc.h>
diff --git a/xbmc/utils/EGLUtils.h b/xbmc/utils/EGLUtils.h
index ad3b04d735..2db1628293 100644
--- a/xbmc/utils/EGLUtils.h
+++ b/xbmc/utils/EGLUtils.h
@@ -14,7 +14,7 @@
#include <string>
#include <vector>
-#include <EGL/egl.h>
+#include "system_egl.h"
class CEGLUtils
{
diff --git a/xbmc/windowing/X11/GLContextEGL.h b/xbmc/windowing/X11/GLContextEGL.h
index f4aecac9ee..865fd28610 100644
--- a/xbmc/windowing/X11/GLContextEGL.h
+++ b/xbmc/windowing/X11/GLContextEGL.h
@@ -9,9 +9,9 @@
#pragma once
#include "GLContext.h"
+#include "system_egl.h"
#include "threads/CriticalSection.h"
-#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <EGL/eglextchromium.h>
#include <X11/Xutil.h>
diff --git a/xbmc/windowing/X11/WinSystemX11GLContext.h b/xbmc/windowing/X11/WinSystemX11GLContext.h
index 30d83e0a64..ae19c6f0ff 100644
--- a/xbmc/windowing/X11/WinSystemX11GLContext.h
+++ b/xbmc/windowing/X11/WinSystemX11GLContext.h
@@ -10,14 +10,13 @@
#include "WinSystemX11.h"
#include "rendering/gl/RenderSystemGL.h"
+#include "system_egl.h"
#include "platform/freebsd/OptionalsReg.h"
#include "platform/linux/OptionalsReg.h"
#include <memory>
-#include <EGL/egl.h>
-
class CGLContext;
namespace KODI
diff --git a/xbmc/windowing/android/AndroidUtils.cpp b/xbmc/windowing/android/AndroidUtils.cpp
index 4d168ad982..a5afacf40a 100644
--- a/xbmc/windowing/android/AndroidUtils.cpp
+++ b/xbmc/windowing/android/AndroidUtils.cpp
@@ -12,6 +12,7 @@
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "settings/lib/SettingsManager.h"
+#include "system_egl.h"
#include "utils/StringUtils.h"
#include "utils/log.h"
#include "windowing/GraphicContext.h"
@@ -21,7 +22,6 @@
#include <cmath>
#include <stdlib.h>
-#include <EGL/egl.h>
#include <androidjni/Build.h>
#include <androidjni/Display.h>
#include <androidjni/System.h>
diff --git a/xbmc/windowing/android/WinSystemAndroid.cpp b/xbmc/windowing/android/WinSystemAndroid.cpp
index 979ba6c258..b4dca4063b 100644
--- a/xbmc/windowing/android/WinSystemAndroid.cpp
+++ b/xbmc/windowing/android/WinSystemAndroid.cpp
@@ -24,6 +24,7 @@
#include "settings/DisplaySettings.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
+#include "system_egl.h"
#include "threads/SingleLock.h"
#include "utils/log.h"
#include "windowing/GraphicContext.h"
@@ -37,7 +38,6 @@
#include <float.h>
#include <string.h>
-#include <EGL/egl.h>
#include <EGL/eglplatform.h>
using namespace KODI;
diff --git a/xbmc/windowing/android/WinSystemAndroid.h b/xbmc/windowing/android/WinSystemAndroid.h
index 4d127590cd..0cf793b72c 100644
--- a/xbmc/windowing/android/WinSystemAndroid.h
+++ b/xbmc/windowing/android/WinSystemAndroid.h
@@ -10,12 +10,11 @@
#include "AndroidUtils.h"
#include "rendering/gles/RenderSystemGLES.h"
+#include "system_egl.h"
#include "threads/CriticalSection.h"
#include "threads/Timer.h"
#include "windowing/WinSystem.h"
-#include <EGL/egl.h>
-
class CDecoderFilterManager;
class IDispResource;
diff --git a/xbmc/windowing/gbm/WinSystemGbm.h b/xbmc/windowing/gbm/WinSystemGbm.h
index c88e398f4f..4bb19b734f 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.h
+++ b/xbmc/windowing/gbm/WinSystemGbm.h
@@ -17,7 +17,6 @@
#include "platform/linux/OptionalsReg.h"
#include "platform/linux/input/LibInputHandler.h"
-#include <EGL/egl.h>
#include <gbm.h>
class IDispResource;
diff --git a/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp b/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp
index 04a53325fc..d8d775dcad 100644
--- a/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp
@@ -87,7 +87,7 @@ bool CWinSystemGbmEGLContext::CreateNewWindow(const std::string& name,
if (!m_eglContext.CreatePlatformSurface(
m_GBM->GetDevice()->GetSurface()->Get(),
- reinterpret_cast<EGLNativeWindowType>(m_GBM->GetDevice()->GetSurface()->Get())))
+ reinterpret_cast<khronos_uintptr_t>(m_GBM->GetDevice()->GetSurface()->Get())))
{
return false;
}
diff --git a/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp b/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp
index b7c7bfa2ee..a3c47e9f4a 100644
--- a/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp
@@ -24,7 +24,6 @@
#include "utils/XTimeUtils.h"
#include "utils/log.h"
-#include <EGL/egl.h>
#include <EGL/eglext.h>
using namespace KODI::WINDOWING::GBM;
diff --git a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
index cf293900ca..20885ccb9f 100644
--- a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
@@ -28,8 +28,6 @@
#include "utils/XTimeUtils.h"
#include "utils/log.h"
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
#include <gbm.h>
using namespace KODI::WINDOWING::GBM;
diff --git a/xbmc/windowing/gbm/drm/DRMLegacy.cpp b/xbmc/windowing/gbm/drm/DRMLegacy.cpp
index 17fee51a70..8afb892dde 100644
--- a/xbmc/windowing/gbm/drm/DRMLegacy.cpp
+++ b/xbmc/windowing/gbm/drm/DRMLegacy.cpp
@@ -18,7 +18,6 @@
#include <stdlib.h>
#include <string.h>
-#include <EGL/egl.h>
#include <drm_mode.h>
#include <fcntl.h>
#include <poll.h>
diff --git a/xbmc/windowing/wayland/WinSystemWaylandEGLContext.cpp b/xbmc/windowing/wayland/WinSystemWaylandEGLContext.cpp
index ac65907212..7c5c301aec 100644
--- a/xbmc/windowing/wayland/WinSystemWaylandEGLContext.cpp
+++ b/xbmc/windowing/wayland/WinSystemWaylandEGLContext.cpp
@@ -70,7 +70,8 @@ bool CWinSystemWaylandEGLContext::CreateNewWindow(const std::string& name,
// CWinSystemWayland::CreateNewWindow sets internal m_bufferSize
// to the resolution that should be used for the initial surface size
// - the compositor might want something other than the resolution given
- if (!m_eglContext.CreatePlatformSurface(m_nativeWindow.c_ptr(), m_nativeWindow.c_ptr()))
+ if (!m_eglContext.CreatePlatformSurface(
+ m_nativeWindow.c_ptr(), reinterpret_cast<khronos_uintptr_t>(m_nativeWindow.c_ptr())))
{
return false;
}
diff --git a/xbmc/windowing/wayland/WinSystemWaylandEGLContextGL.cpp b/xbmc/windowing/wayland/WinSystemWaylandEGLContextGL.cpp
index 2f7bae13b5..05e8997eb1 100644
--- a/xbmc/windowing/wayland/WinSystemWaylandEGLContextGL.cpp
+++ b/xbmc/windowing/wayland/WinSystemWaylandEGLContextGL.cpp
@@ -19,7 +19,6 @@
#include "utils/UDMABufferObject.h"
#include "utils/log.h"
-#include <EGL/egl.h>
#include <EGL/eglext.h>
using namespace KODI::WINDOWING::WAYLAND;
diff --git a/xbmc/windowing/wayland/WinSystemWaylandEGLContextGLES.cpp b/xbmc/windowing/wayland/WinSystemWaylandEGLContextGLES.cpp
index c7ba9a225e..b8c37d8371 100644
--- a/xbmc/windowing/wayland/WinSystemWaylandEGLContextGLES.cpp
+++ b/xbmc/windowing/wayland/WinSystemWaylandEGLContextGLES.cpp
@@ -22,8 +22,6 @@
#include "utils/UDMABufferObject.h"
#include "utils/log.h"
-#include <EGL/egl.h>
-
using namespace KODI::WINDOWING::WAYLAND;
std::unique_ptr<CWinSystemBase> CWinSystemBase::CreateWinSystem()