MythTV  master
mythedid.h
Go to the documentation of this file.
1 #ifndef MYTHEDID_H
2 #define MYTHEDID_H
3 
4 // Qt
5 #include <QSize>
6 #include <QStringList>
7 
8 // MythTV
9 #include "mythuiexp.h"
10 #include "mythhdr.h"
11 #include "mythcolourspace.h"
12 
13 // Std
14 #include <utility>
15 #include <array>
16 #include <tuple>
17 
18 using MythHDRDesc = std::tuple<MythHDR::HDRTypes,double,double,double>;
19 using MythVRRRange = std::tuple<int,int,bool>;
20 
22 {
23  public:
24  MythEDID() = default;
25  explicit MythEDID(QByteArray Data);
26  MythEDID(const char* Data, int Length);
27 
28  bool Valid () const;
29  QStringList SerialNumbers () const;
30  QSize DisplaySize () const;
31  double DisplayAspect () const;
32  uint16_t PhysicalAddress () const;
33  float Gamma () const;
34  bool IsHDMI () const;
35  bool IsSRGB () const;
36  bool IsLikeSRGB () const;
38  int AudioLatency (bool Interlaced) const;
39  int VideoLatency (bool Interlaced) const;
40  void Debug () const;
41  MythHDRDesc GetHDRSupport () const;
42  MythVRRRange GetVRRRange () const;
43 
44  private:
45  enum HDREOTF
46  {
47  SDR = 1 << 0,
48  HDRTrad = 1 << 1,
49  HDR10 = 1 << 2,
50  HLG = 1 << 3
51  };
52 
53  void Parse ();
54  bool ParseBaseBlock (const quint8* Data);
55  void ParseDisplayDescriptor(const quint8* Data, uint Offset);
56  void ParseDetailedTimingDescriptor(const quint8* Data, size_t Offset);
57  bool ParseCTA861 (const quint8* Data, size_t Offset);
58  bool ParseCTABlock (const quint8* Data, size_t Offset);
59  bool ParseVSDB (const quint8* Data, size_t Offset, size_t Length);
60  bool ParseExtended (const quint8* Data, size_t Offset, size_t Length);
61 
62  bool m_valid { false };
63  QByteArray m_data;
64  size_t m_size { 0 };
65  quint8 m_minorVersion { 0 };
66  QSize m_displaySize; // N.B. Either size or aspect are valid
67  double m_displayAspect { 0.0 };
68  QStringList m_serialNumbers;
69  QString m_name;
70  int m_vrangeMin { 0 };
71  int m_vrangeMax { 0 };
72  float m_gamma { 0.0F }; // Invalid
73  bool m_sRGB { false };
74  bool m_likeSRGB { false }; // Temporary until Colourspace handling in libmythui
75  MythColourSpace m_primaries { {{{0.0F}}}, {0.0F} };
76  bool m_isHDMI { false };
77  uint16_t m_physicalAddress { 0 };
78  uint8_t m_deepColor { 0 };
79  bool m_latencies { false };
80  bool m_interLatencies { false };
81  std::array<int,2> m_audioLatency { 0 };
82  std::array<int,2> m_videoLatency { 0 };
83  uint8_t m_deepYUV { 0 };
84  int m_vrrMin { 0 };
85  int m_vrrMax { 0 };
86  int m_hdrMetaTypes { 0 };
87  MythHDR::HDRTypes m_hdrSupport { MythHDR::SDR };
88  double m_maxLuminance { 0.0 };
89  double m_maxAvgLuminance { 0.0 };
90  double m_minLuminance { 0.0 };
91 };
92 
93 #endif
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythEDID::HDREOTF
HDREOTF
Definition: mythedid.h:45
MythEDID::m_serialNumbers
QStringList m_serialNumbers
Definition: mythedid.h:68
MythEDID::m_data
QByteArray m_data
Definition: mythedid.h:63
MythColourSpace
Definition: mythcolourspace.h:18
Parse
Definition: rssparse.h:188
uint
unsigned int uint
Definition: compat.h:81
MythEDID::m_name
QString m_name
Definition: mythedid.h:69
MythVRRRange
std::tuple< int, int, bool > MythVRRRange
Definition: mythedid.h:19
mythcolourspace.h
mythhdr.h
ColourPrimaries
static HostComboBoxSetting * ColourPrimaries()
Definition: globalsettings.cpp:76
MythHDRDesc
std::tuple< MythHDR::HDRTypes, double, double, double > MythHDRDesc
Definition: mythedid.h:18
uint16_t
unsigned short uint16_t
Definition: iso6937tables.h:3
MythHDR::SDR
@ SDR
Definition: mythhdr.h:38
MythEDID::m_displaySize
QSize m_displaySize
Definition: mythedid.h:66
mythuiexp.h
MythEDID
Definition: mythedid.h:21