Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CWinSystemBase Class Referenceabstract

#include <WinSystem.h>

Inheritance diagram for CWinSystemBase:
CWinSystemAndroid CWinSystemIOS CWinSystemOSX CWinSystemTVOS CWinSystemWin10 CWinSystemWin32 KODI::WINDOWING::GBM::CWinSystemGbm KODI::WINDOWING::WAYLAND::CWinSystemWayland KODI::WINDOWING::X11::CWinSystemX11

Public Member Functions

 CWinSystemBase ()
 
virtual ~CWinSystemBase ()
 
virtual CRenderSystemBaseGetRenderSystem ()
 
virtual const std::string GetName ()
 
virtual bool InitWindowSystem ()
 
virtual bool DestroyWindowSystem ()
 
virtual bool CreateNewWindow (const std::string &name, bool fullScreen, RESOLUTION_INFO &res)=0
 
virtual bool DestroyWindow ()
 
virtual bool ResizeWindow (int newWidth, int newHeight, int newLeft, int newTop)=0
 
virtual bool SetFullScreen (bool fullScreen, RESOLUTION_INFO &res, bool blankOtherDisplays)=0
 
virtual bool DisplayHardwareScalingEnabled ()
 
virtual void UpdateDisplayHardwareScaling (const RESOLUTION_INFO &resInfo)
 
virtual bool MoveWindow (int topLeft, int topRight)
 
virtual void FinishModeChange (RESOLUTION res)
 
virtual void FinishWindowResize (int newWidth, int newHeight)
 
virtual bool CenterWindow ()
 
virtual bool IsCreated ()
 
virtual void NotifyAppFocusChange (bool bGaining)
 
virtual void NotifyAppActiveChange (bool bActivated)
 
virtual void ShowOSMouse (bool show)
 
virtual bool HasCursor ()
 
virtual bool HasInertialGestures ()
 
virtual bool UseLimitedColor ()
 
virtual int NoOfBuffers ()
 
virtual void ForceFullScreen (const RESOLUTION_INFO &resInfo)
 Forces the window to fullscreen provided the window resolution.
 
virtual float GetDisplayLatency ()
 Get average display latency.
 
virtual float GetFrameLatencyAdjustment ()
 Get time that should be subtracted from the display latency for this frame in milliseconds.
 
virtual bool Minimize ()
 
virtual bool Restore ()
 
virtual bool Hide ()
 
virtual bool Show (bool raise=true)
 
virtual std::unique_ptr< CVideoSyncGetVideoSync (CVideoReferenceClock *clock)
 
virtual void OnMove (int x, int y)
 
virtual unsigned int GetScreenId (const std::string &screen)
 Get the screen ID provided the screen name.
 
virtual void MoveToScreen (unsigned int screenIdx)
 Window was requested to move to the given screen.
 
virtual void OnChangeScreen (unsigned int screenIdx)
 Used to signal the windowing system about the change of the current screen.
 
KODI::WINDOWING::COSScreenSaverManagerGetOSScreenSaver ()
 Get OS screen saver inhibit implementation if available.
 
unsigned int GetWidth ()
 
unsigned int GetHeight ()
 
virtual bool CanDoWindowed ()
 
bool IsFullScreen ()
 
virtual bool SupportsScreenMove ()
 Check if the windowing system supports moving windows across screens.
 
virtual void UpdateResolutions ()
 
void SetWindowResolution (int width, int height)
 
std::vector< RESOLUTION_WHRScreenResolutions (float refreshrate)
 
std::vector< REFRESHRATERefreshRates (int width, int height, uint32_t dwFlags)
 
REFRESHRATE DefaultRefreshRate (const std::vector< REFRESHRATE > &rates)
 
virtual bool HasCalibration (const RESOLUTION_INFO &resInfo)
 
virtual std::string GetClipboardText (void)
 
virtual void Register (IDispResource *resource)=0
 
virtual void Unregister (IDispResource *resource)=0
 
void RegisterRenderLoop (IRenderLoop *client)
 
void UnregisterRenderLoop (IRenderLoop *client)
 
void DriveRenderLoop ()
 
virtual bool MessagePump ()
 
virtual CGraphicContextGetGfxContext () const
 
virtual voidGetHWContext ()
 Get OS specific hardware context.
 
std::shared_ptr< CDPMSSupportGetDPMSManager ()
 
virtual bool SetHDR (const VideoPicture *videoPicture)
 Set the HDR metadata. Passing nullptr as the parameter should disable HDR.
 
virtual bool IsHDRDisplay ()
 
virtual HDR_STATUS ToggleHDR ()
 
virtual HDR_STATUS GetOSHDRStatus ()
 
virtual CHDRCapabilities GetDisplayHDRCapabilities () const
 
virtual float GetGuiSdrPeakLuminance () const
 
virtual bool HasSystemSdrPeakLuminance ()
 
virtual bool SupportsVideoSuperResolution ()
 System supports Video Super Resolution HW upscaler i.e.: "NVIDIA RTX Video Super Resolution" or "Intel Video Super Resolution".
 
virtual DEBUG_INFO_RENDER GetDebugInfo ()
 Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)
 
virtual std::vector< std::string > GetConnectedOutputs ()
 
bool IsHDRDisplaySettingEnabled ()
 Return true when HDR display is available and enabled in settings.
 
bool IsVideoSuperResolutionSettingEnabled ()
 Return true when "Video Super Resolution" is supported and enabled in settings.
 
bool IsHighPrecisionProcessingSettingEnabled ()
 Return true when setting "High Precision Processing" is enabled.
 
std::pair< bool, intGetDitherSettings ()
 Get dither settings.
 

Static Public Member Functions

static std::unique_ptr< CWinSystemBaseCreateWinSystem ()
 

Static Public Attributes

static const char * SETTING_WINSYSTEM_IS_HDR_DISPLAY = "winsystem.ishdrdisplay"
 

Protected Member Functions

void UpdateDesktopResolution (RESOLUTION_INFO &newRes, const std::string &output, int width, int height, float refreshRate, uint32_t dwFlags)
 
void UpdateDesktopResolution (RESOLUTION_INFO &newRes, const std::string &output, int width, int height, int screenWidth, int screenHeight, float refreshRate, uint32_t dwFlags)
 
virtual std::unique_ptr< KODI::WINDOWING::IOSScreenSaverGetOSScreenSaverImpl ()
 

Protected Attributes

int m_nWidth = 0
 
int m_nHeight = 0
 
int m_nTop = 0
 
int m_nLeft = 0
 
bool m_bWindowCreated = false
 
bool m_bFullScreen = false
 
bool m_bBlankOtherDisplay = false
 
float m_fRefreshRate = 0.0f
 
std::unique_ptr< KODI::WINDOWING::COSScreenSaverManagerm_screenSaverManager
 
CCriticalSection m_renderLoopSection
 
std::vector< IRenderLoop * > m_renderLoopClients
 
std::unique_ptr< IWinEventsm_winEvents
 
std::unique_ptr< CGraphicContextm_gfxContext
 
std::shared_ptr< CDPMSSupportm_dpms
 

Constructor & Destructor Documentation

◆ CWinSystemBase()

CWinSystemBase::CWinSystemBase ( )

◆ ~CWinSystemBase()

CWinSystemBase::~CWinSystemBase ( )
virtualdefault

Member Function Documentation

◆ CanDoWindowed()

virtual bool CWinSystemBase::CanDoWindowed ( )
inlinevirtual

◆ CenterWindow()

virtual bool CWinSystemBase::CenterWindow ( )
inlinevirtual

Reimplemented in CWinSystemWin32.

◆ CreateNewWindow()

◆ CreateWinSystem()

static std::unique_ptr< CWinSystemBase > CWinSystemBase::CreateWinSystem ( )
static

◆ DefaultRefreshRate()

REFRESHRATE CWinSystemBase::DefaultRefreshRate ( const std::vector< REFRESHRATE > & rates)

◆ DestroyWindow()

◆ DestroyWindowSystem()

◆ DisplayHardwareScalingEnabled()

virtual bool CWinSystemBase::DisplayHardwareScalingEnabled ( )
inlinevirtual

◆ DriveRenderLoop()

void CWinSystemBase::DriveRenderLoop ( )

◆ FinishModeChange()

virtual void CWinSystemBase::FinishModeChange ( RESOLUTION res)
inlinevirtual

◆ FinishWindowResize()

◆ ForceFullScreen()

virtual void CWinSystemBase::ForceFullScreen ( const RESOLUTION_INFO & resInfo)
inlinevirtual

Forces the window to fullscreen provided the window resolution.

Parameters
resInfo- the resolution info

Reimplemented in CWinSystemWin10, and CWinSystemWin32.

◆ GetClipboardText()

std::string CWinSystemBase::GetClipboardText ( void )
virtual

◆ GetConnectedOutputs()

virtual std::vector< std::string > CWinSystemBase::GetConnectedOutputs ( )
inlinevirtual

◆ GetDebugInfo()

virtual DEBUG_INFO_RENDER CWinSystemBase::GetDebugInfo ( )
inlinevirtual

Gets debug info from video renderer for use in "Debug Info OSD" (Alt + O)

Reimplemented in CWinSystemWin10DX, and CWinSystemWin32DX.

◆ GetDisplayHDRCapabilities()

virtual CHDRCapabilities CWinSystemBase::GetDisplayHDRCapabilities ( ) const
inlinevirtual

◆ GetDisplayLatency()

virtual float CWinSystemBase::GetDisplayLatency ( )
inlinevirtual

Get average display latency.

The latency should be measured as the time between finishing the rendering of a frame, i.e. calling PresentRender, and the rendered content becoming visible on the screen.

Returns
average display latency in seconds, or negative value if unknown

Reimplemented in KODI::WINDOWING::WAYLAND::CWinSystemWayland.

◆ GetDitherSettings()

std::pair< bool, int > CWinSystemBase::GetDitherSettings ( )

Get dither settings.

Returns
std::pair containing dither enabled (bool) and dither depth (int)

◆ GetDPMSManager()

std::shared_ptr< CDPMSSupport > CWinSystemBase::GetDPMSManager ( )

◆ GetFrameLatencyAdjustment()

virtual float CWinSystemBase::GetFrameLatencyAdjustment ( )
inlinevirtual

Get time that should be subtracted from the display latency for this frame in milliseconds.

Contrary to GetDisplayLatency, this value is calculated ad-hoc for the frame currently being rendered and not a value that is calculated/ averaged from past frames and their presentation times

Reimplemented in CWinSystemAndroidGLESContext, KODI::WINDOWING::WAYLAND::CWinSystemWayland, and KODI::WINDOWING::X11::CWinSystemX11GLContext.

◆ GetGfxContext()

CGraphicContext & CWinSystemBase::GetGfxContext ( ) const
virtual

◆ GetGuiSdrPeakLuminance()

virtual float CWinSystemBase::GetGuiSdrPeakLuminance ( ) const
inlinevirtual

◆ GetHeight()

unsigned int CWinSystemBase::GetHeight ( )
inline

◆ GetHWContext()

virtual void * CWinSystemBase::GetHWContext ( )
inlinevirtual

Get OS specific hardware context.

Returns
OS specific context or nullptr if OS not have
Note
This function is currently only related to Windows with DirectX, all other OS where use GL returns nullptr. Returned Windows class pointer is ID3D11DeviceContext1.

Reimplemented in CWinSystemWin10DX, and CWinSystemWin32DX.

◆ GetName()

virtual const std::string CWinSystemBase::GetName ( )
inlinevirtual

◆ GetOSHDRStatus()

virtual HDR_STATUS CWinSystemBase::GetOSHDRStatus ( )
inlinevirtual

Reimplemented in CWinSystemWin10DX, and CWinSystemWin32DX.

◆ GetOSScreenSaver()

KODI::WINDOWING::COSScreenSaverManager * CWinSystemBase::GetOSScreenSaver ( )

Get OS screen saver inhibit implementation if available.

Returns
OS screen saver implementation that can be used with this windowing system or nullptr if unsupported. Lifetime of the returned object will usually end with DestroyWindowSystem, so do not use any more after calling that.

◆ GetOSScreenSaverImpl()

◆ GetRenderSystem()

◆ GetScreenId()

virtual unsigned int CWinSystemBase::GetScreenId ( const std::string & screen)
inlinevirtual

Get the screen ID provided the screen name.

Parameters
screenthe name of the screen as presented on the application display settings
Returns
the screen index as known by the windowing system implementation (or the default screen by default)

Reimplemented in CWinSystemOSX.

◆ GetVideoSync()

◆ GetWidth()

unsigned int CWinSystemBase::GetWidth ( )
inline

◆ HasCalibration()

virtual bool CWinSystemBase::HasCalibration ( const RESOLUTION_INFO & resInfo)
inlinevirtual

◆ HasCursor()

◆ HasInertialGestures()

virtual bool CWinSystemBase::HasInertialGestures ( )
inlinevirtual

Reimplemented in CWinSystemWin10, and CWinSystemWin32.

◆ HasSystemSdrPeakLuminance()

virtual bool CWinSystemBase::HasSystemSdrPeakLuminance ( )
inlinevirtual

Reimplemented in CWinSystemWin10, and CWinSystemWin32.

◆ Hide()

◆ InitWindowSystem()

◆ IsCreated()

virtual bool CWinSystemBase::IsCreated ( )
inlinevirtual

◆ IsFullScreen()

bool CWinSystemBase::IsFullScreen ( )
inline

◆ IsHDRDisplay()

virtual bool CWinSystemBase::IsHDRDisplay ( )
inlinevirtual

◆ IsHDRDisplaySettingEnabled()

bool CWinSystemBase::IsHDRDisplaySettingEnabled ( )

Return true when HDR display is available and enabled in settings.

◆ IsHighPrecisionProcessingSettingEnabled()

bool CWinSystemBase::IsHighPrecisionProcessingSettingEnabled ( )

Return true when setting "High Precision Processing" is enabled.

◆ IsVideoSuperResolutionSettingEnabled()

bool CWinSystemBase::IsVideoSuperResolutionSettingEnabled ( )

Return true when "Video Super Resolution" is supported and enabled in settings.

◆ MessagePump()

◆ Minimize()

◆ MoveToScreen()

virtual void CWinSystemBase::MoveToScreen ( unsigned int screenIdx)
inlinevirtual

Window was requested to move to the given screen.

Parameters
screenIdxthe screen index as known by the windowing system implementation

Reimplemented in CWinSystemOSX.

◆ MoveWindow()

virtual bool CWinSystemBase::MoveWindow ( int topLeft,
int topRight )
inlinevirtual

◆ NoOfBuffers()

int CWinSystemBase::NoOfBuffers ( void )
virtual

◆ NotifyAppActiveChange()

virtual void CWinSystemBase::NotifyAppActiveChange ( bool bActivated)
inlinevirtual

◆ NotifyAppFocusChange()

virtual void CWinSystemBase::NotifyAppFocusChange ( bool bGaining)
inlinevirtual

◆ OnChangeScreen()

virtual void CWinSystemBase::OnChangeScreen ( unsigned int screenIdx)
inlinevirtual

Used to signal the windowing system about the change of the current screen.

Parameters
screenIdxthe screen index as known by the windowing system implementation

Reimplemented in CWinSystemOSX.

◆ OnMove()

virtual void CWinSystemBase::OnMove ( int x,
int y )
inlinevirtual

◆ RefreshRates()

std::vector< REFRESHRATE > CWinSystemBase::RefreshRates ( int width,
int height,
uint32_t dwFlags )

◆ Register()

◆ RegisterRenderLoop()

void CWinSystemBase::RegisterRenderLoop ( IRenderLoop * client)

◆ ResizeWindow()

◆ Restore()

virtual bool CWinSystemBase::Restore ( )
inlinevirtual

◆ ScreenResolutions()

std::vector< RESOLUTION_WHR > CWinSystemBase::ScreenResolutions ( float refreshrate)

◆ SetFullScreen()

◆ SetHDR()

virtual bool CWinSystemBase::SetHDR ( const VideoPicture * videoPicture)
inlinevirtual

Set the HDR metadata. Passing nullptr as the parameter should disable HDR.

Reimplemented in CWinSystemAndroidGLESContext, and KODI::WINDOWING::GBM::CWinSystemGbm.

◆ SetWindowResolution()

void CWinSystemBase::SetWindowResolution ( int width,
int height )

◆ Show()

◆ ShowOSMouse()

◆ SupportsScreenMove()

virtual bool CWinSystemBase::SupportsScreenMove ( )
inlinevirtual

Check if the windowing system supports moving windows across screens.

Returns
true if the windowing system supports moving windows across screens, false otherwise

◆ SupportsVideoSuperResolution()

virtual bool CWinSystemBase::SupportsVideoSuperResolution ( )
inlinevirtual

System supports Video Super Resolution HW upscaler i.e.: "NVIDIA RTX Video Super Resolution" or "Intel Video Super Resolution".

Reimplemented in CWinSystemWin32DX.

◆ ToggleHDR()

virtual HDR_STATUS CWinSystemBase::ToggleHDR ( )
inlinevirtual

Reimplemented in CWinSystemWin10DX, and CWinSystemWin32DX.

◆ Unregister()

◆ UnregisterRenderLoop()

void CWinSystemBase::UnregisterRenderLoop ( IRenderLoop * client)

◆ UpdateDesktopResolution() [1/2]

void CWinSystemBase::UpdateDesktopResolution ( RESOLUTION_INFO & newRes,
const std::string & output,
int width,
int height,
float refreshRate,
uint32_t dwFlags )
protected

◆ UpdateDesktopResolution() [2/2]

void CWinSystemBase::UpdateDesktopResolution ( RESOLUTION_INFO & newRes,
const std::string & output,
int width,
int height,
int screenWidth,
int screenHeight,
float refreshRate,
uint32_t dwFlags )
protected

◆ UpdateDisplayHardwareScaling()

virtual void CWinSystemBase::UpdateDisplayHardwareScaling ( const RESOLUTION_INFO & resInfo)
inlinevirtual

◆ UpdateResolutions()

◆ UseLimitedColor()

Member Data Documentation

◆ m_bBlankOtherDisplay

bool CWinSystemBase::m_bBlankOtherDisplay = false
protected

◆ m_bFullScreen

bool CWinSystemBase::m_bFullScreen = false
protected

◆ m_bWindowCreated

bool CWinSystemBase::m_bWindowCreated = false
protected

◆ m_dpms

std::shared_ptr<CDPMSSupport> CWinSystemBase::m_dpms
protected

◆ m_fRefreshRate

float CWinSystemBase::m_fRefreshRate = 0.0f
protected

◆ m_gfxContext

std::unique_ptr<CGraphicContext> CWinSystemBase::m_gfxContext
protected

◆ m_nHeight

int CWinSystemBase::m_nHeight = 0
protected

◆ m_nLeft

int CWinSystemBase::m_nLeft = 0
protected

◆ m_nTop

int CWinSystemBase::m_nTop = 0
protected

◆ m_nWidth

int CWinSystemBase::m_nWidth = 0
protected

◆ m_renderLoopClients

std::vector<IRenderLoop*> CWinSystemBase::m_renderLoopClients
protected

◆ m_renderLoopSection

CCriticalSection CWinSystemBase::m_renderLoopSection
protected

◆ m_screenSaverManager

std::unique_ptr<KODI::WINDOWING::COSScreenSaverManager> CWinSystemBase::m_screenSaverManager
protected

◆ m_winEvents

std::unique_ptr<IWinEvents> CWinSystemBase::m_winEvents
protected

◆ SETTING_WINSYSTEM_IS_HDR_DISPLAY

const char * CWinSystemBase::SETTING_WINSYSTEM_IS_HDR_DISPLAY = "winsystem.ishdrdisplay"
static

The documentation for this class was generated from the following files: