MythTV  master
Public Slots | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
MythDisplayMutter Class Reference

A subclass of MythDisplay using the org.gnome.Mutter.DisplayConfig DBUS interface. More...

#include <mythdisplaymutter.h>

Inheritance diagram for MythDisplayMutter:
Inheritance graph
[legend]
Collaboration diagram for MythDisplayMutter:
Collaboration graph
[legend]

Public Slots

void MonitorsChanged ()
 
- Public Slots inherited from MythDisplay
virtual void ScreenChanged (QScreen *qScreen)
 The actual screen in use has changed. We must use it. More...
 
static void PrimaryScreenChanged (QScreen *qScreen)
 
void ScreenAdded (QScreen *qScreen)
 
void ScreenRemoved (QScreen *qScreen)
 
void PhysicalDPIChanged (qreal DPI)
 
static void GeometryChanged (QRect Geometry)
 

Public Member Functions

 ~MythDisplayMutter () override
 
void UpdateCurrentMode () override
 Retrieve screen details. More...
 
bool VideoModesAvailable () override
 
bool UsingVideoModes () override
 
const MythDisplayModesGetVideoModes (void) override
 
bool SwitchToVideoMode (QSize Size, double DesiredRate) override
 
- Public Member Functions inherited from MythDisplay
virtual bool IsPlanar ()
 
QStringList GetDescription ()
 
QRect GetScreenBounds ()
 
QScreen * GetCurrentScreen ()
 Return a pointer to the screen to use. More...
 
double GetPixelAspectRatio ()
 
QSize GetGUIResolution ()
 
bool NextModeIsLarger (QSize Size)
 Check whether the next mode is larger in size than the current mode. More...
 
void SwitchToDesktop ()
 Return the screen to the original desktop video mode. More...
 
bool SwitchToGUI (bool Wait=false)
 Switches to the GUI resolution. More...
 
bool SwitchToVideo (QSize Size, double Rate=0.0)
 Switches to the resolution and refresh rate defined in the database for the specified video resolution and frame rate. More...
 
QSize GetResolution ()
 
QSize GetPhysicalSize ()
 
double GetRefreshRate () const
 
std::chrono::microseconds GetRefreshInterval (std::chrono::microseconds Fallback) const
 
double GetAspectRatio (QString &Source, bool IgnoreModeOverride=false)
 Returns current screen aspect ratio. More...
 
double EstimateVirtualAspectRatio ()
 Estimate the overall display aspect ratio for multi screen setups. More...
 
MythEDIDGetEDID ()
 
MythDisplayRates GetRefreshRates (QSize Size)
 
MythHDRPtr GetHDRState ()
 

Static Public Member Functions

static MythDisplayMutterCreate ()
 Create a valid instance. More...
 
- Static Public Member Functions inherited from MythDisplay
static void ConfigureQtGUI (int SwapInterval, const MythCommandLineParser &CmdLine)
 Shared static initialisation code for all MythTV GUI applications. More...
 
static bool SpanAllScreens ()
 Return true if the MythTV windows should span all screens. More...
 
static QString GetExtraScreenInfo (QScreen *qScreen)
 
static int GetScreenCount ()
 

Private Member Functions

 MythDisplayMutter ()
 
bool IsValid ()
 
void InitialiseInterface ()
 
void UpdateResources ()
 

Private Attributes

QDBusInterface * m_interface { nullptr }
 
uint32_t m_serialVal { 0 }
 
MythMutterCRTCList m_crtcs
 
MythMutterOutputList m_outputs
 
MythMutterModeList m_modes
 
int m_outputIdx { -1 }
 
QMap< uint64_t, uint32_t > m_modeMap
 

Additional Inherited Members

- Signals inherited from MythDisplay
void CurrentScreenChanged (QScreen *qScreen)
 
void ScreenCountChanged (int Screens)
 
void CurrentDPIChanged (qreal DPI)
 
- Protected Member Functions inherited from MythDisplay
 MythDisplay ()
 
 ~MythDisplay () override
 
void DebugModes () const
 
void SetWidget (QWidget *MainWindow)
 Set the QWidget and QWindow in use. More...
 
void Initialise ()
 
void InitScreenBounds ()
 Get screen size from Qt while respecting the user's multiscreen settings. More...
 
void WaitForScreenChange ()
 
void WaitForNewScreen ()
 
void InitHDR ()
 
- Static Protected Member Functions inherited from MythDisplay
static MythDisplayCreate (MythMainWindow *MainWindow)
 Create a MythDisplay object appropriate for the current platform. More...
 
static QScreen * GetDesiredScreen ()
 
static void DebugScreen (QScreen *qScreen, const QString &Message)
 
- Protected Attributes inherited from MythDisplay
bool m_waitForModeChanges { true }
 
bool m_modeComplete { false }
 
double m_refreshRate { 0.0 }
 
double m_aspectRatioOverride { 0.0 }
 
QSize m_resolution { 0, 0 }
 
QSize m_physicalSize { 0, 0 }
 
MythEDID m_edid
 
QWidget * m_widget { nullptr }
 
QWindow * m_window { nullptr }
 
QScreen * m_screen { nullptr }
 
MythDisplayModes m_videoModes
 
MythHDRPtr m_hdrState { nullptr }
 
MythVRRPtr m_vrrState { nullptr }
 

Detailed Description

A subclass of MythDisplay using the org.gnome.Mutter.DisplayConfig DBUS interface.

This class is intended to be used on Linux installations that are running 'pure' Wayland desktops (i.e. not Wayland on top of X). When X11 is available, MythDisplayX11 is more suitable.

If the interface is available but the 'ApplyConfiguration' method is not implemented, then MythDisplay should fallback to an alternative subclass - typically MythDisplayDRM (Wayland will be using DRM under the hood but MythTV will not have the necessary permissions to switch resolutions/refresh rates).

Note
Not all Wayland compositors will implement this interface - so it does not provide a universal solution for Wayland.

Definition at line 78 of file mythdisplaymutter.h.

Constructor & Destructor Documentation

◆ ~MythDisplayMutter()

MythDisplayMutter::~MythDisplayMutter ( )
override

Definition at line 276 of file mythdisplaymutter.cpp.

◆ MythDisplayMutter()

MythDisplayMutter::MythDisplayMutter ( )
private

Definition at line 270 of file mythdisplaymutter.cpp.

Referenced by Create().

Member Function Documentation

◆ Create()

MythDisplayMutter * MythDisplayMutter::Create ( )
static

Create a valid instance.

If org.gnome.Mutter.DisplayConfig is not available or the ApplyConfiguration method is not implemented, a null pointer is returned.

Definition at line 191 of file mythdisplaymutter.cpp.

◆ UpdateCurrentMode()

void MythDisplayMutter::UpdateCurrentMode ( )
overridevirtual

Retrieve screen details.

This is the final fallback when no other platform specifics are available It is usually accurate apart from the refresh rate - which is often rounded down.

Reimplemented from MythDisplay.

Definition at line 344 of file mythdisplaymutter.cpp.

◆ VideoModesAvailable()

bool MythDisplayMutter::VideoModesAvailable ( )
inlineoverridevirtual

Reimplemented from MythDisplay.

Definition at line 87 of file mythdisplaymutter.h.

◆ UsingVideoModes()

bool MythDisplayMutter::UsingVideoModes ( )
overridevirtual

Reimplemented from MythDisplay.

Definition at line 292 of file mythdisplaymutter.cpp.

◆ GetVideoModes()

const MythDisplayModes & MythDisplayMutter::GetVideoModes ( void  )
overridevirtual

Reimplemented from MythDisplay.

Definition at line 299 of file mythdisplaymutter.cpp.

◆ SwitchToVideoMode()

bool MythDisplayMutter::SwitchToVideoMode ( QSize  Size,
double  DesiredRate 
)
overridevirtual
Note
This is currently untested on a fully functional org.gnome.Mutter.DisplayConfig implementation

Reimplemented from MythDisplay.

Definition at line 391 of file mythdisplaymutter.cpp.

◆ MonitorsChanged

void MythDisplayMutter::MonitorsChanged ( )
slot

Definition at line 286 of file mythdisplaymutter.cpp.

Referenced by InitialiseInterface().

◆ IsValid()

bool MythDisplayMutter::IsValid ( )
private

Definition at line 281 of file mythdisplaymutter.cpp.

◆ InitialiseInterface()

void MythDisplayMutter::InitialiseInterface ( )
private

Definition at line 356 of file mythdisplaymutter.cpp.

Referenced by MythDisplayMutter().

◆ UpdateResources()

void MythDisplayMutter::UpdateResources ( )
private

Definition at line 464 of file mythdisplaymutter.cpp.

Referenced by MonitorsChanged(), and UpdateCurrentMode().

Member Data Documentation

◆ m_interface

QDBusInterface* MythDisplayMutter::m_interface { nullptr }
private

◆ m_serialVal

uint32_t MythDisplayMutter::m_serialVal { 0 }
private

Definition at line 102 of file mythdisplaymutter.h.

Referenced by SwitchToVideoMode(), and UpdateResources().

◆ m_crtcs

MythMutterCRTCList MythDisplayMutter::m_crtcs
private

Definition at line 103 of file mythdisplaymutter.h.

Referenced by SwitchToVideoMode(), and UpdateResources().

◆ m_outputs

MythMutterOutputList MythDisplayMutter::m_outputs
private

Definition at line 104 of file mythdisplaymutter.h.

Referenced by GetVideoModes(), and UpdateResources().

◆ m_modes

MythMutterModeList MythDisplayMutter::m_modes
private

Definition at line 105 of file mythdisplaymutter.h.

Referenced by GetVideoModes(), and UpdateResources().

◆ m_outputIdx

int MythDisplayMutter::m_outputIdx { -1 }
private

Definition at line 106 of file mythdisplaymutter.h.

Referenced by GetVideoModes(), and UpdateResources().

◆ m_modeMap

QMap<uint64_t, uint32_t> MythDisplayMutter::m_modeMap
private

Definition at line 107 of file mythdisplaymutter.h.

Referenced by GetVideoModes(), and SwitchToVideoMode().


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