MythTV  master
mythedid.h
Go to the documentation of this file.
1 #ifndef MYTHEDID_H
2 #define MYTHEDID_H
3 
4 // C++
5 #include <array>
6 
7 // Qt
8 #include <QSize>
9 #include <QStringList>
10 
11 // MythTV
12 #include "mythuiexp.h"
13 
15 {
16  public:
17  // This structure matches VideoColourSpace::ColourPrimaries
18  // TODO move ColourPrimaries into MythDisplay
19  struct Primaries
20  {
21  float primaries[3][2];
22  float whitepoint[2];
23  };
24 
25  MythEDID(void) = default;
26  explicit MythEDID(QByteArray &Data);
27  MythEDID(const char* Data, int Length);
28 
29  bool Valid (void) const;
30  QStringList SerialNumbers (void) const;
31  QSize DisplaySize (void) const;
32  double DisplayAspect (void) const;
33  uint16_t PhysicalAddress (void) const;
34  float Gamma (void) const;
35  bool IsHDMI (void) const;
36  bool IsSRGB (void) const;
37  bool IsLikeSRGB (void) const;
38  Primaries ColourPrimaries (void) const;
39  int AudioLatency (bool Interlaced) const;
40  int VideoLatency (bool Interlaced) const;
41  void Debug (void) const;
42 
43  private:
44  void Parse (void);
45  bool ParseBaseBlock (const quint8 *Data);
46  bool ParseCTA861 (const quint8 *Data, uint Offset);
47  bool ParseCTABlock (const quint8 *Data, uint Offset);
48  bool ParseVSDB (const quint8 *Data, uint Offset, uint Length);
49 
50  bool m_valid { false };
51  QByteArray m_data { };
52  uint m_size { 0 };
53  quint8 m_minorVersion { 0 };
54  QSize m_displaySize { }; // N.B. Either size or aspect are valid
55  double m_displayAspect { 0.0 };
56  QStringList m_serialNumbers { };
57  float m_gamma { 0.0F }; // Invalid
58  bool m_sRGB { false };
59  bool m_likeSRGB { false }; // Temporary until Colourspace handling in libmythui
60  Primaries m_primaries { {{0.0F, 0.0F}, {0.0F, 0.0F}, {0.0F, 0.0F}}, {0.0F, 0.0F} };
61  bool m_isHDMI { false };
62  uint16_t m_physicalAddress { 0 };
63  bool m_latencies { false };
64  bool m_interLatencies { false };
65  int m_audioLatency[2] { 0 };
66  int m_videoLatency[2] { 0 };
67 };
68 
69 #endif // MYTHEDID_H
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
Parse
Definition: rssparse.h:189
MythEDID::MythEDID
MythEDID(void)=default
uint
unsigned int uint
Definition: compat.h:140
ColourPrimaries
static HostComboBoxSetting * ColourPrimaries()
Definition: globalsettings.cpp:73
MythEDID::Primaries
Definition: mythedid.h:20
uint16_t
unsigned short uint16_t
Definition: iso6937tables.h:1
mythuiexp.h
MythEDID
Definition: mythedid.h:15