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
18using MythHDRDesc = std::tuple<MythHDR::HDRTypes,double,double,double>;
19using 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 : std::uint8_t
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
QSize m_displaySize
Definition: mythedid.h:66
QStringList m_serialNumbers
Definition: mythedid.h:68
MythEDID()=default
QByteArray m_data
Definition: mythedid.h:63
QString m_name
Definition: mythedid.h:69
@ SDR
Definition: mythhdr.h:38
unsigned int uint
Definition: freesurround.h:24
static HostComboBoxSetting * ColourPrimaries()
unsigned short uint16_t
Definition: iso6937tables.h:3
std::tuple< MythHDR::HDRTypes, double, double, double > MythHDRDesc
Definition: mythedid.h:18
std::tuple< int, int, bool > MythVRRRange
Definition: mythedid.h:19
#define MUI_PUBLIC
Definition: mythuiexp.h:9