MythTV master
mythdrmdevice.h
Go to the documentation of this file.
1#ifndef MYTHDRMDEVICE_H
2#define MYTHDRMDEVICE_H
3
4#include "libmythbase/mythconfig.h"
5
6// MythTV
8#if CONFIG_QTPRIVATEHEADERS
10#endif
15
16// Std
17#include <memory>
18
19using MythDRMPtr = std::shared_ptr<class MythDRMDevice>;
20using MythAtomic = std::tuple<uint32_t,uint32_t,uint64_t>;
21using MythAtomics = std::vector<MythAtomic>;
22
23static constexpr const char* DRM_QUIET { "Shush" };
24
26{
27 public:
28 static std::tuple<QString,QStringList> GetDeviceList();
29 static MythDRMPtr Create(QScreen *qScreen, const QString& Device = QString(), bool NeedPlanes = true);
31
32 bool Authenticated () const;
33 bool Atomic () const;
34 int GetFD () const;
35 QString GetSerialNumber() const;
36 QScreen* GetScreen () const;
37 QSize GetResolution () const;
38 QSize GetPhysicalSize() const;
39 double GetRefreshRate () const;
40 MythEDID GetEDID () const;
41 DRMCrtc GetCrtc () const;
42 DRMConn GetConnector () const;
43 const DRMModes& GetModes() const;
44 bool CanSwitchModes () const;
45 bool SwitchMode (int ModeIndex);
46
47#if CONFIG_QTPRIVATEHEADERS
48 static inline bool s_mythDRMVideo = qEnvironmentVariableIsSet("MYTHTV_DRM_VIDEO");
49 static inline bool s_planarRequested = false;
50 static inline bool s_planarSetup = false;
51 static inline QString s_mythDRMDevice = qEnvironmentVariable("MYTHTV_DRM_DEVICE");
52 static inline QString s_mythDRMConnector = qEnvironmentVariable("MYTHTV_DRM_CONNECTOR");
53 static inline QString s_mythDRMVideoMode = qEnvironmentVariable("MYTHTV_DRM_MODE");
54 static MythDRMPtr FindDevice(bool NeedPlanes = true);
55 static void SetupDRM (const MythCommandLineParser& CmdLine);
56 DRMPlane GetVideoPlane () const;
57 DRMPlane GetGUIPlane () const;
58 bool QueueAtomics (const MythAtomics& Atomics) const;
59 void DisableVideoPlane();
60 void MainWindowReady ();
61
62 protected:
63 MythDRMDevice(QString Device, bool NeedPlanes);
64 MythDRMDevice(int Fd, uint32_t CrtcId, uint32_t ConnectorId, bool Atomic);
65
66 private:
67 void AnalysePlanes ();
68 DRMPlane m_videoPlane { nullptr };
69 DRMPlane m_guiPlane { nullptr };
70#endif
71
72 protected:
73 explicit MythDRMDevice(QScreen* qScreen, const QString& Device = QString());
74
75 private:
76 Q_DISABLE_COPY(MythDRMDevice)
77 bool Open ();
78 void Authenticate ();
79 void Load ();
80 bool Initialise ();
81 QString FindBestDevice ();
82 static bool ConfirmDevice(const QString& Device);
83
84 bool m_valid { false };
85 QScreen* m_screen { nullptr };
86 QString m_deviceName;
87 bool m_openedDevice { true };
88 int m_fd { -1 };
89 bool m_atomic { false };
90 bool m_authenticated { false };
95 DRMConn m_connector { nullptr };
96 DRMCrtc m_crtc { nullptr };
99 double m_refreshRate { 0.0 };
100 double m_adjustedRefreshRate { 0.0 };
102 LogLevel_t m_verbose { LOG_INFO };
104};
105
106#endif
A device containing images (ie. USB stick, CD, storage group etc)
Parent class for defining application command line parsers.
DRMCrtcs m_crtcs
Definition: mythdrmdevice.h:93
DRMPlanes m_planes
Definition: mythdrmdevice.h:94
QSize m_physicalSize
Definition: mythdrmdevice.h:98
QSize m_resolution
Definition: mythdrmdevice.h:97
QString m_deviceName
Definition: mythdrmdevice.h:86
DRMConns m_connectors
Definition: mythdrmdevice.h:91
MythEDID m_edid
DRMEncs m_encoders
Definition: mythdrmdevice.h:92
QString m_serialNumber
std::vector< DRMConn > DRMConns
std::shared_ptr< class MythDRMConnector > DRMConn
std::shared_ptr< class MythDRMCrtc > DRMCrtc
Definition: mythdrmcrtc.h:8
std::vector< DRMCrtc > DRMCrtcs
Definition: mythdrmcrtc.h:9
static constexpr const char * DRM_QUIET
Definition: mythdrmdevice.h:23
std::tuple< uint32_t, uint32_t, uint64_t > MythAtomic
Definition: mythdrmdevice.h:20
std::shared_ptr< class MythDRMDevice > MythDRMPtr
Definition: mythdrmdevice.h:19
std::vector< MythAtomic > MythAtomics
Definition: mythdrmdevice.h:21
std::vector< DRMEnc > DRMEncs
Definition: mythdrmencoder.h:8
std::vector< DRMMode > DRMModes
Definition: mythdrmmode.h:8
std::vector< DRMPlane > DRMPlanes
Definition: mythdrmplane.h:51
std::shared_ptr< class MythDRMPlane > DRMPlane
Definition: mythdrmplane.h:50
#define MUI_PUBLIC
Definition: mythuiexp.h:9