kodi
WinSystemAndroidGLESContext.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "WinSystemAndroid.h"
12 #include "rendering/gles/RenderSystemGLES.h"
13 #include "utils/EGLUtils.h"
14 #include "utils/GlobalsHandling.h"
15 
16 struct AVMasteringDisplayMetadata;
17 struct AVContentLightMetadata;
18 
20 {
21 public:
22  CWinSystemAndroidGLESContext() = default;
23  ~CWinSystemAndroidGLESContext() override = default;
24 
25  static void Register();
26  static std::unique_ptr<CWinSystemBase> CreateWinSystem();
27 
28  // Implementation of CWinSystemBase via CWinSystemAndroid
29  CRenderSystemBase *GetRenderSystem() override { return this; }
30  bool InitWindowSystem() override;
31  bool CreateNewWindow(const std::string& name,
32  bool fullScreen,
33  RESOLUTION_INFO& res) override;
34 
35  bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) override;
36  bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) override;
37 
38  std::unique_ptr<CVideoSync> GetVideoSync(CVideoReferenceClock* clock) override;
39 
40  float GetFrameLatencyAdjustment() override;
41  bool IsHDRDisplay() override;
42  bool SetHDR(const VideoPicture* videoPicture) override;
43 
44  EGLDisplay GetEGLDisplay() const;
45  EGLSurface GetEGLSurface() const;
46  EGLContext GetEGLContext() const;
47  EGLConfig GetEGLConfig() const;
48 protected:
49  void SetVSyncImpl(bool enable) override;
50  void PresentRenderImpl(bool rendered) override;
51 
52 private:
53  bool CreateSurface();
54 
55  CEGLContextUtils m_pGLContext;
56  bool m_hasHDRConfig = false;
57 
58  std::unique_ptr<AVMasteringDisplayMetadata> m_displayMetadata;
59  std::unique_ptr<AVContentLightMetadata> m_lightMetadata;
60  EGLint m_HDRColorSpace = EGL_NONE;
61  bool m_hasEGL_ST2086_Extension = false;
62  bool m_hasEGL_BT2020_PQ_Colorspace_Extension = false;
63 };
bool SetHDR(const VideoPicture *videoPicture) override
Set the HDR metadata. Passing nullptr as the parameter should disable HDR.
Definition: WinSystemAndroidGLESContext.cpp:224
Definition: WinSystemAndroid.h:25
float GetFrameLatencyAdjustment() override
Get time that should be subtracted from the display latency for this frame in milliseconds.
Definition: WinSystemAndroidGLESContext.cpp:147
Definition: RenderSystemGLES.h:73
Definition: WinSystemAndroidGLESContext.h:19
Definition: RenderSystem.h:27
Provide info of a resolution.
Definition: Resolution.h:66
Definition: VideoReferenceClock.h:19
Definition: DVDVideoCodec.h:36
Definition: EGLUtils.h:166