MythTV  master
mythdrmplane.h
Go to the documentation of this file.
1 #ifndef MYTHDRMPLANE_H
2 #define MYTHDRMPLANE_H
3 
4 // MythTV
6 
7 // libdrm
8 extern "C" {
9 #include <drm_fourcc.h>
10 }
11 
12 #ifndef DRM_FORMAT_INVALID
13 #define DRM_FORMAT_INVALID 0
14 #endif
15 #ifndef DRM_FORMAT_NV15
16 #define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5')
17 #endif
18 #ifndef DRM_FORMAT_NV20
19 #define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0')
20 #endif
21 #ifndef DRM_FORMAT_P210
22 #define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0')
23 #endif
24 #ifndef DRM_FORMAT_P010
25 #define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0')
26 #endif
27 #ifndef DRM_FORMAT_P012
28 #define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2')
29 #endif
30 #ifndef DRM_FORMAT_P016
31 #define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6')
32 #endif
33 #ifndef DRM_FORMAT_P030
34 #define DRM_FORMAT_P030 fourcc_code('P', '0', '3', '0')
35 #endif
36 #ifndef DRM_FORMAT_XRGB16161616F
37 #define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H')
38 #endif
39 #ifndef DRM_FORMAT_XBGR16161616F
40 #define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H')
41 #endif
42 #ifndef DRM_FORMAT_ARGB16161616F
43 #define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')
44 #endif
45 #ifndef DRM_FORMAT_ABGR16161616F
46 #define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')
47 #endif
48 
49 using FOURCCVec = std::vector<uint32_t>;
50 using DRMPlane = std::shared_ptr<class MythDRMPlane>;
51 using DRMPlanes = std::vector<DRMPlane>;
52 
54 {
55  public:
56  static DRMPlane Create(int FD, uint32_t Id, uint32_t Index);
57  static DRMPlanes GetPlanes(int FD, int CRTCFilter = -1);
58 
59  static QString PlaneTypeToString (uint64_t Type);
60  static DRMPlanes FilterPrimaryPlanes (const DRMPlanes& Planes);
61  static DRMPlanes FilterOverlayPlanes (const DRMPlanes& Planes);
62  static QString FormatToString (uint32_t Format);
63  static QString FormatsToString (const FOURCCVec& Formats);
64  static bool FormatIsVideo (uint32_t Format);
65  static bool HasOverlayFormat (const FOURCCVec& Formats);
66  static uint32_t GetAlphaFormat (const FOURCCVec& Formats);
67  QString Description() const;
68 
69  uint32_t m_id { 0 };
70  uint32_t m_index { 0 };
71  uint64_t m_type { DRM_PLANE_TYPE_PRIMARY };
72  uint32_t m_possibleCrtcs { 0 };
73  uint32_t m_fbId { 0 };
74  uint32_t m_crtcId { 0 };
76 
77  DRMProp m_fbIdProp { nullptr };
78  DRMProp m_crtcIdProp { nullptr };
79  DRMProp m_srcXProp { nullptr };
80  DRMProp m_srcYProp { nullptr };
81  DRMProp m_srcWProp { nullptr };
82  DRMProp m_srcHProp { nullptr };
83  DRMProp m_crtcXProp { nullptr };
84  DRMProp m_crtcYProp { nullptr };
85  DRMProp m_crtcWProp { nullptr };
86  DRMProp m_crtcHProp { nullptr };
87 
90 
91  protected:
92  MythDRMPlane(int FD, uint32_t Id, uint32_t Index);
93 
94  private:
95  Q_DISABLE_COPY(MythDRMPlane)
96 };
97 
98 #endif
mythdrmproperty.h
DRMProps
std::vector< DRMProp > DRMProps
Definition: mythdrmproperty.h:8
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
FOURCCVec
std::vector< uint32_t > FOURCCVec
Definition: mythdrmplane.h:49
MythDate::Format
Format
Definition: mythdate.h:15
DRMProp
std::shared_ptr< class MythDRMProperty > DRMProp
Definition: mythdrmproperty.h:7
DRMPlanes
std::vector< DRMPlane > DRMPlanes
Definition: mythdrmplane.h:51
MythDRMPlane::m_videoFormats
FOURCCVec m_videoFormats
Definition: mythdrmplane.h:89
MythDRMPlane::m_formats
FOURCCVec m_formats
Definition: mythdrmplane.h:88
DRMPlane
std::shared_ptr< class MythDRMPlane > DRMPlane
Definition: mythdrmplane.h:50
MythDRMPlane
A wrapper around a DRM plane object.
Definition: mythdrmplane.h:53
MythDRMPlane::m_properties
DRMProps m_properties
Definition: mythdrmplane.h:75