kodi
DisplayInfo.h
1 /*
2  * Copyright (C) 2023 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <memory>
12 #include <stdint.h>
13 #include <string>
14 #include <vector>
15 
16 struct di_info;
17 struct di_cta_colorimetry_block;
18 struct di_cta_hdr_static_metadata_block;
19 
20 namespace KODI
21 {
22 namespace UTILS
23 {
24 
25 enum class Eotf
26 {
27  TRADITIONAL_SDR,
28  TRADITIONAL_HDR,
29  PQ,
30  HLG,
31 };
32 
33 enum class Colorimetry
34 {
35  DEFAULT,
36  XVYCC_601,
37  XVYCC_709,
38  SYCC_601,
39  OPYCC_601,
40  OPRGB,
41  BT2020_CYCC,
42  BT2020_YCC,
43  BT2020_RGB,
44  ST2113_RGB,
45  ICTCP,
46 };
47 
49 {
50 public:
51  static std::unique_ptr<CDisplayInfo> Create(const std::vector<uint8_t>& edid);
52 
53  ~CDisplayInfo();
54 
55  bool SupportsHDRStaticMetadataType1() const;
56 
57  bool SupportsEOTF(Eotf eotf) const;
58 
59  bool SupportsColorimetry(Colorimetry colorimetry) const;
60 
61 private:
62  explicit CDisplayInfo(const std::vector<uint8_t>& edid);
63 
64  bool IsValid() const;
65  void Parse();
66  void LogInfo() const;
67 
68  struct DiInfoDeleter
69  {
70  void operator()(di_info* p);
71  };
72 
73  std::unique_ptr<di_info, DiInfoDeleter> m_info;
74 
75  std::string m_make;
76  std::string m_model;
77 
78  const di_cta_colorimetry_block* m_colorimetry = nullptr;
79  const di_cta_hdr_static_metadata_block* m_hdr_static_metadata = nullptr;
80 };
81 
82 } // namespace UTILS
83 } // namespace KODI
Definition: DisplayInfo.h:48
Definition: ColorUtils.h:18
Definition: AudioDecoder.h:18