OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_EDID_PARSER_X11_H_ |
| 6 #define BASE_EDID_PARSER_X11_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/base_export.h" |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 typedef unsigned long XID; |
| 14 |
| 15 namespace base { |
| 16 |
| 17 // Get the EDID data from the |output| and stores to |prop|. |nitem| will store |
| 18 // the number of characters |prop| will have. It doesn't take the ownership of |
| 19 // |prop|, so caller must release it by XFree(). |
| 20 // Returns true if EDID property is successfully obtained. Otherwise returns |
| 21 // false and does not touch |prop| and |nitems|. |
| 22 BASE_EXPORT bool GetEDIDProperty(XID output, |
| 23 unsigned long* nitems, |
| 24 unsigned char** prop); |
| 25 |
| 26 // Gets the EDID data from |output| and generates the display id through |
| 27 // |GetDisplayIdFromEDID|. |
| 28 BASE_EXPORT bool GetDisplayId(XID output, size_t index, |
| 29 int64* display_id_out); |
| 30 |
| 31 // Generates the display id for the pair of |prop| with |nitems| length and |
| 32 // |index|, and store in |display_id_out|. Returns true if the display id is |
| 33 // successfully generated, or false otherwise. |
| 34 BASE_EXPORT bool GetDisplayIdFromEDID(const unsigned char* prop, |
| 35 unsigned long nitems, |
| 36 size_t index, |
| 37 int64* display_id_out); |
| 38 |
| 39 // Parses |prop| as EDID data and stores extracted data into |manufacturer_id| |
| 40 // and |human_readable_name| and returns true. NULL can be passed for unwanted |
| 41 // output parameters. Some devices (especially internal displays) may not have |
| 42 // the field for |human_readable_name|, and it will return true in that case. |
| 43 BASE_EXPORT bool ParseOutputDeviceData(const unsigned char* prop, |
| 44 unsigned long nitems, |
| 45 uint16* manufacturer_id, |
| 46 std::string* human_readable_name); |
| 47 |
| 48 } // namespace base |
| 49 |
| 50 #endif // BASE_EDID_PARSER_X11_H_ |
OLD | NEW |