Chromium Code Reviews| Index: base/edid_parser_x11.h |
| diff --git a/base/edid_parser_x11.h b/base/edid_parser_x11.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a75e793d5f4859a0b65ce75852655f45bf2a3b27 |
| --- /dev/null |
| +++ b/base/edid_parser_x11.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_EDID_PARSER_X11_H_ |
| +#define BASE_EDID_PARSER_X11_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/base_export.h" |
| +#include "base/basictypes.h" |
| + |
| +typedef unsigned long XID; |
| + |
| +namespace base { |
|
Elliot Glaysher
2013/09/19 20:53:12
Why put this in base? Because it's the only locati
|
| + |
| +// Get the EDID data from the |output| and stores to |prop|. |nitem| will store |
| +// the number of characters |prop| will have. It doesn't take the ownership of |
| +// |prop|, so caller must release it by XFree(). |
| +// Returns true if EDID property is successfully obtained. Otherwise returns |
| +// false and does not touch |prop| and |nitems|. |
| +BASE_EXPORT bool GetEDIDProperty(XID output, |
| + unsigned long* nitems, |
| + unsigned char** prop); |
| + |
| +// Gets the EDID data from |output| and generates the display id through |
| +// |GetDisplayIdFromEDID|. |
| +BASE_EXPORT bool GetDisplayId(XID output, size_t index, |
| + int64* display_id_out); |
| + |
| +// Generates the display id for the pair of |prop| with |nitems| length and |
| +// |index|, and store in |display_id_out|. Returns true if the display id is |
| +// successfully generated, or false otherwise. |
| +BASE_EXPORT bool GetDisplayIdFromEDID(const unsigned char* prop, |
| + unsigned long nitems, |
| + size_t index, |
| + int64* display_id_out); |
| + |
| +// Parses |prop| as EDID data and stores extracted data into |manufacturer_id| |
| +// and |human_readable_name| and returns true. NULL can be passed for unwanted |
| +// output parameters. Some devices (especially internal displays) may not have |
| +// the field for |human_readable_name|, and it will return true in that case. |
| +BASE_EXPORT bool ParseOutputDeviceData(const unsigned char* prop, |
| + unsigned long nitems, |
| + uint16* manufacturer_id, |
| + std::string* human_readable_name); |
| + |
| +} // namespace base |
| + |
| +#endif // BASE_EDID_PARSER_X11_H_ |