MythTV  master
mythdrmdevice.h
Go to the documentation of this file.
1 #ifndef MYTHDRMDEVICE_H
2 #define MYTHDRMDEVICE_H
3 
4 // Qt
5 #include <QString>
6 
7 // MythTV
8 #include "mythlogging.h"
9 #include "referencecounter.h"
10 #include "mythdisplay.h"
11 
12 // libdrm
13 extern "C" {
14 #include <xf86drm.h>
15 #include <xf86drmMode.h>
16 }
17 
19 {
20  public:
21  explicit MythDRMDevice(QScreen *qScreen, const QString& Device = QString());
22  ~MythDRMDevice() override;
23 
24  bool IsValid (void) const;
25  QString GetSerialNumber(void) const;
26  QScreen* GetScreen (void) const;
27  QSize GetResolution (void) const;
28  QSize GetPhysicalSize(void) const;
29  double GetRefreshRate (void) const;
30  bool Authenticated (void) const;
31  MythEDID GetEDID (void);
32 
33  private:
34  Q_DISABLE_COPY(MythDRMDevice)
35  bool Open (void);
36  void Close (void);
37  void Authenticate (void);
38  bool Initialise (void);
39 
40  QString FindBestDevice (void);
41  static bool ConfirmDevice(const QString& Device);
42 
43  drmModePropertyBlobPtr GetBlobProperty(drmModeConnectorPtr Connector, const QString& Property) const;
44 
45  private:
46  bool m_valid { false };
47  QScreen* m_screen { nullptr };
48  QString m_deviceName { };
49  int m_fd { -1 };
50  bool m_authenticated { false };
51  drmModeRes* m_resources { nullptr };
52  drmModeConnector* m_connector { nullptr };
53  QSize m_resolution { };
54  QSize m_physicalSize { };
55  double m_refreshRate { 0.0 };
56  QString m_serialNumber { };
57  drmModeCrtc* m_crtc { nullptr };
58  int m_crtcIdx { -1 };
59  LogLevel_t m_verbose { LOG_INFO };
61 };
62 
63 #endif // MYTHDRMDEVICE_H
MythDRMDevice::m_authenticated
bool m_authenticated
Definition: mythdrmdevice.h:50
MythDRMDevice::m_screen
QScreen * m_screen
Definition: mythdrmdevice.h:47
MythDRMDevice::Authenticate
void Authenticate(void)
Definition: mythdrmdevice.cpp:132
MythDRMDevice::Authenticated
bool Authenticated(void) const
Definition: mythdrmdevice.cpp:110
MythDRMDevice::Open
bool Open(void)
Definition: mythdrmdevice.cpp:42
MythDRMDevice::IsValid
bool IsValid(void) const
Definition: mythdrmdevice.cpp:80
MythDRMDevice::m_resources
drmModeRes * m_resources
Definition: mythdrmdevice.h:51
MythDRMDevice::GetSerialNumber
QString GetSerialNumber(void) const
Definition: mythdrmdevice.cpp:85
MythDRMDevice::Close
void Close(void)
Definition: mythdrmdevice.cpp:61
MythDRMDevice::m_resolution
QSize m_resolution
Definition: mythdrmdevice.h:53
MythDRMDevice::m_serialNumber
QString m_serialNumber
Definition: mythdrmdevice.h:56
Device
A device containing images (ie. USB stick, CD, storage group etc)
Definition: imagemanager.cpp:34
Property
Definition: upnpcdsobjects.h:45
MythDRMDevice::m_valid
bool m_valid
Definition: mythdrmdevice.h:46
MythDRMDevice::GetBlobProperty
drmModePropertyBlobPtr GetBlobProperty(drmModeConnectorPtr Connector, const QString &Property) const
Definition: mythdrmdevice.cpp:358
MythDRMDevice::m_verbose
LogLevel_t m_verbose
Definition: mythdrmdevice.h:59
mythdisplay.h
mythlogging.h
MythDRMDevice::MythDRMDevice
MythDRMDevice(QScreen *qScreen, const QString &Device=QString())
Definition: mythdrmdevice.cpp:17
MythDRMDevice::GetResolution
QSize GetResolution(void) const
Definition: mythdrmdevice.cpp:95
MythDRMDevice::m_connector
drmModeConnector * m_connector
Definition: mythdrmdevice.h:52
MythDRMDevice
Definition: mythdrmdevice.h:19
MythDRMDevice::m_crtc
drmModeCrtc * m_crtc
Definition: mythdrmdevice.h:57
referencecounter.h
MythDRMDevice::m_edid
MythEDID m_edid
Definition: mythdrmdevice.h:60
MythDRMDevice::m_deviceName
QString m_deviceName
Definition: mythdrmdevice.h:48
MythDRMDevice::GetEDID
MythEDID GetEDID(void)
Definition: mythdrmdevice.cpp:115
MythDRMDevice::m_refreshRate
double m_refreshRate
Definition: mythdrmdevice.h:55
MythDRMDevice::GetScreen
QScreen * GetScreen(void) const
Definition: mythdrmdevice.cpp:90
MythDRMDevice::Initialise
bool Initialise(void)
Definition: mythdrmdevice.cpp:147
MythDRMDevice::m_crtcIdx
int m_crtcIdx
Definition: mythdrmdevice.h:58
MythDRMDevice::~MythDRMDevice
~MythDRMDevice() override
Definition: mythdrmdevice.cpp:37
MythDRMDevice::GetRefreshRate
double GetRefreshRate(void) const
Definition: mythdrmdevice.cpp:105
MythDRMDevice::GetPhysicalSize
QSize GetPhysicalSize(void) const
Definition: mythdrmdevice.cpp:100
MythDRMDevice::m_physicalSize
QSize m_physicalSize
Definition: mythdrmdevice.h:54
MythDRMDevice::m_fd
int m_fd
Definition: mythdrmdevice.h:49
MythDRMDevice::FindBestDevice
QString FindBestDevice(void)
Definition: mythdrmdevice.cpp:291
ReferenceCounter
General purpose reference counter.
Definition: referencecounter.h:27
MythEDID
Definition: mythedid.h:18
MythDRMDevice::ConfirmDevice
static bool ConfirmDevice(const QString &Device)
Definition: mythdrmdevice.cpp:342