1 #ifndef MYTHDRMDEVICE_H
2 #define MYTHDRMDEVICE_H
7 #if defined (USING_QTPRIVATEHEADERS)
19 using MythAtomic = std::tuple<uint32_t,uint32_t,uint64_t>;
22 #define DRM_QUIET "Shush"
27 static std::tuple<QString,QStringList> GetDeviceList();
28 static MythDRMPtr Create(QScreen *qScreen,
const QString&
Device = QString(),
bool NeedPlanes =
true);
31 bool Authenticated ()
const;
34 QString GetSerialNumber()
const;
35 QScreen* GetScreen ()
const;
36 QSize GetResolution ()
const;
37 QSize GetPhysicalSize()
const;
38 double GetRefreshRate ()
const;
43 bool CanSwitchModes ()
const;
44 bool SwitchMode (
int ModeIndex);
46 #if defined (USING_QTPRIVATEHEADERS)
47 static inline bool s_mythDRMVideo = qEnvironmentVariableIsSet(
"MYTHTV_DRM_VIDEO");
48 static inline bool s_planarRequested =
false;
49 static inline bool s_planarSetup =
false;
50 #if QT_VERSION < QT_VERSION_CHECK(5,10,0)
51 static inline QString s_mythDRMDevice = QString(qgetenv(
"MYTHTV_DRM_DEVICE"));
52 static inline QString s_mythDRMConnector = QString(qgetenv(
"MYTHTV_DRM_CONNECTOR"));
53 static inline QString s_mythDRMVideoMode = QString(qgetenv(
"MYTHTV_DRM_MODE"));
55 static inline QString s_mythDRMDevice = qEnvironmentVariable(
"MYTHTV_DRM_DEVICE");
56 static inline QString s_mythDRMConnector = qEnvironmentVariable(
"MYTHTV_DRM_CONNECTOR");
57 static inline QString s_mythDRMVideoMode = qEnvironmentVariable(
"MYTHTV_DRM_MODE");
59 static MythDRMPtr FindDevice(
bool NeedPlanes =
true);
64 void DisableVideoPlane();
65 void MainWindowReady ();
69 MythDRMDevice(
int Fd, uint32_t CrtcId, uint32_t ConnectorId,
bool Atomic);
72 void AnalysePlanes ();
86 QString FindBestDevice ();
87 static bool ConfirmDevice(
const QString&
Device);
89 bool m_valid {
false };
90 QScreen* m_screen {
nullptr };
91 QString m_deviceName { };
92 bool m_openedDevice {
true };
94 bool m_atomic {
false };
95 bool m_authenticated {
false };
102 QSize m_resolution { };
103 QSize m_physicalSize { };
104 double m_refreshRate { 0.0 };
105 double m_adjustedRefreshRate { 0.0 };
106 QString m_serialNumber { };
107 LogLevel_t m_verbose { LOG_INFO };