11 #include "HDRStatus.h" 12 #include "OSScreenSaver.h" 13 #include "Resolution.h" 14 #include "VideoSync.h" 15 #include "WinEvents.h" 16 #include "cores/VideoPlayer/VideoRenderers/DebugInfo.h" 17 #include "guilib/DispResource.h" 18 #include "utils/HDRCapabilities.h" 55 static std::unique_ptr<CWinSystemBase> CreateWinSystem();
60 virtual const std::string GetName() {
return "platform default"; }
63 virtual bool InitWindowSystem();
64 virtual bool DestroyWindowSystem();
65 virtual bool CreateNewWindow(
const std::string& name,
bool fullScreen,
RESOLUTION_INFO& res) = 0;
66 virtual bool DestroyWindow(){
return false; }
67 virtual bool ResizeWindow(
int newWidth,
int newHeight,
int newLeft,
int newTop) = 0;
68 virtual bool SetFullScreen(
bool fullScreen,
RESOLUTION_INFO& res,
bool blankOtherDisplays) = 0;
69 virtual bool DisplayHardwareScalingEnabled() {
return false; }
70 virtual void UpdateDisplayHardwareScaling(
const RESOLUTION_INFO& resInfo) { }
71 virtual bool MoveWindow(
int topLeft,
int topRight){
return false;}
72 virtual void FinishModeChange(RESOLUTION res){}
73 virtual void FinishWindowResize(
int newWidth,
int newHeight) {ResizeWindow(newWidth, newHeight, -1, -1);}
74 virtual bool CenterWindow(){
return false;}
75 virtual bool IsCreated(){
return m_bWindowCreated; }
76 virtual void NotifyAppFocusChange(
bool bGaining) {}
77 virtual void NotifyAppActiveChange(
bool bActivated) {}
78 virtual void ShowOSMouse(
bool show) {}
79 virtual bool HasCursor(){
return true; }
81 virtual bool HasInertialGestures(){
return false; }
83 virtual bool UseLimitedColor();
85 virtual int NoOfBuffers();
114 virtual bool Minimize() {
return false; }
115 virtual bool Restore() {
return false; }
116 virtual bool Hide() {
return false; }
117 virtual bool Show(
bool raise =
true) {
return false; }
120 virtual std::unique_ptr<CVideoSync> GetVideoSync(
CVideoReferenceClock* clock) {
return nullptr; }
123 virtual void OnMove(
int x,
int y) {}
131 virtual unsigned int GetScreenId(
const std::string& screen) {
return 0; }
159 unsigned int GetWidth() {
return m_nWidth; }
160 unsigned int GetHeight() {
return m_nHeight; }
161 virtual bool CanDoWindowed() {
return true; }
162 bool IsFullScreen() {
return m_bFullScreen; }
171 virtual void UpdateResolutions();
172 void SetWindowResolution(
int width,
int height);
173 std::vector<RESOLUTION_WHR> ScreenResolutions(
float refreshrate);
174 std::vector<REFRESHRATE> RefreshRates(
int width,
int height, uint32_t dwFlags);
175 REFRESHRATE DefaultRefreshRate(
const std::vector<REFRESHRATE>& rates);
176 virtual bool HasCalibration(
const RESOLUTION_INFO& resInfo) {
return true; }
179 virtual std::string GetClipboardText(
void);
188 void DriveRenderLoop();
191 virtual bool MessagePump() {
return false; }
207 std::shared_ptr<CDPMSSupport> GetDPMSManager();
215 virtual bool IsHDRDisplay() {
return false; }
216 virtual HDR_STATUS ToggleHDR() {
return HDR_STATUS::HDR_UNSUPPORTED; }
217 virtual HDR_STATUS GetOSHDRStatus() {
return HDR_STATUS::HDR_UNSUPPORTED; }
219 static const char* SETTING_WINSYSTEM_IS_HDR_DISPLAY;
220 virtual float GetGuiSdrPeakLuminance()
const {
return .0f; }
221 virtual bool HasSystemSdrPeakLuminance() {
return false; }
236 virtual std::vector<std::string> GetConnectedOutputs() {
return {}; }
242 bool IsHDRDisplaySettingEnabled();
248 bool IsVideoSuperResolutionSettingEnabled();
254 bool IsHighPrecisionProcessingSettingEnabled();
261 std::pair<bool, int> GetDitherSettings();
264 void UpdateDesktopResolution(
RESOLUTION_INFO& newRes,
const std::string &output,
int width,
int height,
float refreshRate, uint32_t dwFlags);
266 const std::string& output,
273 virtual std::unique_ptr<KODI::WINDOWING::IOSScreenSaver> GetOSScreenSaverImpl() {
return nullptr; }
279 bool m_bWindowCreated =
false;
280 bool m_bFullScreen =
false;
281 bool m_bBlankOtherDisplay =
false;
282 float m_fRefreshRate = 0.0f;
283 std::unique_ptr<KODI::WINDOWING::COSScreenSaverManager> m_screenSaverManager;
284 CCriticalSection m_renderLoopSection;
285 std::vector<IRenderLoop*> m_renderLoopClients;
287 std::unique_ptr<IWinEvents> m_winEvents;
288 std::unique_ptr<CGraphicContext> m_gfxContext;
289 std::shared_ptr<CDPMSSupport> m_dpms;
Definition: WinSystem.h:24
Definition: WinSystem.h:35
Definition: DPMSSupport.h:18
Definition: DispResource.h:26
virtual float GetDisplayLatency()
Get average display latency.
Definition: WinSystem.h:102
Definition: WinSystem.h:49
virtual void ForceFullScreen(const RESOLUTION_INFO &resInfo)
Forces the window to fullscreen provided the window resolution.
Definition: WinSystem.h:91
virtual bool SetHDR(const VideoPicture *videoPicture)
Set the HDR metadata. Passing nullptr as the parameter should disable HDR.
Definition: WinSystem.h:214
Definition: RenderSystem.h:27
virtual bool SupportsVideoSuperResolution()
System supports Video Super Resolution HW upscaler i.e.: "NVIDIA RTX Video Super Resolution" or "Inte...
Definition: WinSystem.h:228
Definition: DispResource.h:14
Provide info of a resolution.
Definition: Resolution.h:66
virtual DEBUG_INFO_RENDER GetDebugInfo()
Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)
Definition: WinSystem.h:234
virtual float GetFrameLatencyAdjustment()
Get time that should be subtracted from the display latency for this frame in milliseconds.
Definition: WinSystem.h:112
virtual void * GetHWContext()
Get OS specific hardware context.
Definition: WinSystem.h:205
Definition: DebugInfo.h:30
Definition: VideoReferenceClock.h:19
virtual unsigned int GetScreenId(const std::string &screen)
Get the screen ID provided the screen name.
Definition: WinSystem.h:131
Manage the OS screen saver.
Definition: OSScreenSaver.h:92
virtual void MoveToScreen(unsigned int screenIdx)
Window was requested to move to the given screen.
Definition: WinSystem.h:138
Definition: DVDVideoCodec.h:36
virtual bool SupportsScreenMove()
Check if the windowing system supports moving windows across screens.
Definition: WinSystem.h:169
virtual void OnChangeScreen(unsigned int screenIdx)
Used to signal the windowing system about the change of the current screen.
Definition: WinSystem.h:145
Definition: HDRCapabilities.h:11
Definition: GraphicContext.h:60