OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_DISPLAY_UTIL_EDID_PARSER_H_ | 5 #ifndef UI_DISPLAY_UTIL_EDID_PARSER_H_ |
6 #define UI_DISPLAY_UTIL_EDID_PARSER_H_ | 6 #define UI_DISPLAY_UTIL_EDID_PARSER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ui/display/util/display_util_export.h" | 13 #include "ui/display/util/display_util_export.h" |
14 | 14 |
| 15 namespace gfx { |
| 16 class Size; |
| 17 } |
| 18 |
15 // EDID (Extended Display Identification Data) is a format for monitor | 19 // EDID (Extended Display Identification Data) is a format for monitor |
16 // metadata. This provides a parser for the data. | 20 // metadata. This provides a parser for the data. |
17 | 21 |
18 namespace ui { | 22 namespace ui { |
19 | 23 |
20 // Generates the display id for the pair of |edid| and |index|, and store in | 24 // Generates the display id for the pair of |edid| and |index|, and store in |
21 // |display_id_out|. Returns true if the display id is successfully generated, | 25 // |display_id_out|. Returns true if the display id is successfully generated, |
22 // or false otherwise. | 26 // or false otherwise. |
23 DISPLAY_UTIL_EXPORT bool GetDisplayIdFromEDID(const std::vector<uint8_t>& edid, | 27 DISPLAY_UTIL_EXPORT bool GetDisplayIdFromEDID(const std::vector<uint8_t>& edid, |
24 uint8_t index, | 28 uint8_t index, |
25 int64_t* display_id_out); | 29 int64_t* display_id_out); |
26 | 30 |
27 // Parses |edid| as EDID data and stores extracted data into |manufacturer_id| | 31 // Parses |edid| as EDID data and stores extracted data into |manufacturer_id|, |
28 // and |human_readable_name| and returns true. NULL can be passed for unwanted | 32 // |human_readable_name|, |active_pixel_out| and |physical_display_size_out|, th
en |
29 // output parameters. Some devices (especially internal displays) may not have | 33 // returns true. nullptr can be passed for unwanted output parameters. Some |
30 // the field for |human_readable_name|, and it will return true in that case. | 34 // devices (especially internal displays) may not have the field for |
31 DISPLAY_UTIL_EXPORT bool ParseOutputDeviceData( | 35 // |human_readable_name|, and it will return true in that case. |
32 const std::vector<uint8_t>& edid, | 36 DISPLAY_UTIL_EXPORT bool ParseOutputDeviceData(const std::vector<uint8_t>& edid, |
33 uint16_t* manufacturer_id, | 37 uint16_t* manufacturer_id, |
34 std::string* human_readable_name); | 38 std::string* human_readable_name, |
| 39 gfx::Size* active_pixel_out, |
| 40 gfx::Size* physical_display_size_
out); |
35 | 41 |
36 DISPLAY_UTIL_EXPORT bool ParseOutputOverscanFlag( | 42 DISPLAY_UTIL_EXPORT bool ParseOutputOverscanFlag( |
37 const std::vector<uint8_t>& edid, | 43 const std::vector<uint8_t>& edid, |
38 bool* flag); | 44 bool* flag); |
39 | 45 |
40 } // namespace ui | 46 } // namespace ui |
41 | 47 |
42 #endif // UI_DISPLAY_UTIL_EDID_PARSER_H_ | 48 #endif // UI_DISPLAY_UTIL_EDID_PARSER_H_ |
OLD | NEW |