Chromium Code Reviews| Index: chromeos/display/output_configurator.h |
| diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h |
| index 5891785381cb22161e41415a98e62b8fd00679b1..9f48e545d05d719843f6a6289f3f2b0ce36dc8fc 100644 |
| --- a/chromeos/display/output_configurator.h |
| +++ b/chromeos/display/output_configurator.h |
| @@ -25,6 +25,10 @@ typedef XID RROutput; |
| typedef XID RRCrtc; |
| typedef XID RRMode; |
| +namespace chrome { |
| +class PepperOutputProtectionHost; |
|
Daniel Erat
2013/09/18 22:39:16
this doesn't appear to be used here
kcwu
2013/09/20 03:03:47
Done.
|
| +} // namespace chrome |
| + |
| namespace chromeos { |
| // Used to describe the state of a multi-display configuration. |
| @@ -36,6 +40,23 @@ enum OutputState { |
| STATE_DUAL_EXTENDED, |
| }; |
| +// Video output link types. |
|
marcheu
2013/09/18 23:21:35
The terminology "link" isn't used in this code, ca
kcwu
2013/09/20 03:03:47
Done.
|
| +enum OutputLinkType { |
| + OUTPUT_LINK_TYPE_NONE = 0, |
| + OUTPUT_LINK_TYPE_UNKNOWN = 1 << 0, |
| + OUTPUT_LINK_TYPE_INTERNAL = 1 << 1, |
| + OUTPUT_LINK_TYPE_VGA = 1 << 2, |
| + OUTPUT_LINK_TYPE_HDMI = 1 << 3, |
| + OUTPUT_LINK_TYPE_DVI = 1 << 4, |
| + OUTPUT_LINK_TYPE_DISPLAYPORT = 1 << 5, |
| +}; |
| + |
|
marcheu
2013/09/18 23:21:35
Same here, we just use the term "output", not "out
kcwu
2013/09/20 03:03:47
Done.
|
| +// Content protection methods applied on video output link. |
| +enum OutputProtectionMethod { |
| + OUTPUT_PROTECTION_METHOD_NONE = 0, |
| + OUTPUT_PROTECTION_METHOD_HDCP = 1 << 0, |
| +}; |
| + |
| // This class interacts directly with the underlying Xrandr API to manipulate |
| // CTRCs and Outputs. |
| class CHROMEOS_EXPORT OutputConfigurator |
| @@ -218,6 +239,23 @@ class CHROMEOS_EXPORT OutputConfigurator |
| // Sends a D-Bus message to the power manager telling it that the |
| // machine is or is not projecting. |
| virtual void SendProjectingStateToPowerManager(bool projecting) = 0; |
| + |
| + // Register a client for output protection and request a client id. Returns |
|
Daniel Erat
2013/09/18 22:39:16
nit: make these verbs match the tense in other com
kcwu
2013/09/20 03:03:47
Done.
|
| + // 0 if requesting failed. |
| + virtual uint64_t RegisterOutputProtectionClient() = 0; |
|
Daniel Erat
2013/09/18 22:39:16
mind typedef-ing uint64_t to something like Output
kcwu
2013/09/20 03:03:47
Done.
|
| + // Unregister the client. |
|
Daniel Erat
2013/09/18 22:39:16
nit: please add blank lines between methods
kcwu
2013/09/20 03:03:47
Done.
|
| + virtual void UnregisterOutputProtectionClient(uint64_t client_id) = 0; |
|
Daniel Erat
2013/09/18 22:39:16
document that the server _does_ need to be grabbed
kcwu
2013/09/20 03:03:47
This is done in output_configurator.cc
|
| + // Query link status and protection status. Returns true on success. |
| + virtual bool QueryOutputProtectionStatus( |
| + uint64_t client_id, |
| + uint32_t* link_mask, |
| + uint32_t* protection_mask) = 0; |
| + |
| + // Request the desired protection methods. Returns true when the protection |
| + // request has been made. |
| + virtual bool EnableOutputProtection( |
| + uint64_t client_id, |
| + uint32_t desired_method_mask) = 0; |
|
Daniel Erat
2013/09/18 22:39:16
what does |desired_method_mask| contain? if it's o
kcwu
2013/09/20 03:03:47
This follows the naming in ppapi/api/private/ppb_o
|
| }; |
| // Helper class used by tests. |
| @@ -348,6 +386,30 @@ class CHROMEOS_EXPORT OutputConfigurator |
| // so that time-consuming ConfigureOutputs() won't be called multiple times. |
| void ScheduleConfigureOutputs(); |
| + // Register a client for output protection and request a client id. Returns |
| + // 0 if requesting failed. |
| + uint64_t RegisterOutputProtectionClient(); |
|
Daniel Erat
2013/09/18 22:39:16
nit: please add comments between these methods too
kcwu
2013/09/20 03:03:47
Do you mean blank line?
|
| + // Unregister the client. |
| + void UnregisterOutputProtectionClient(uint64_t client_id); |
| + // Query link status and protection status. |
| + // |link_mask| is the type of connected output links, which is a bitmask |
| + // of PP_OutputProtectionLinkType_Private values. |protection_mask| is the |
| + // desired protection methods, which is a bitmask of the |
| + // PP_OutputProtectionMethod_Private values. |
|
Daniel Erat
2013/09/18 22:39:16
are the masks actually PP_*_Private values, or are
kcwu
2013/09/20 03:03:47
Done.
Ah, forgot to change this. PP_*_Private valu
|
| + // Returns true on success. |
| + bool QueryOutputProtectionStatus( |
| + uint64_t client_id, |
| + uint32_t* link_mask, |
| + uint32_t* protection_mask); |
| + |
| + // Request the desired protection methods. |
| + // |protection_mask| is the desired protection methods, which is a bitmask |
| + // of the PP_OutputProtectionMethod_Private values. |
| + // Returns true when the protection request has been made. |
| + bool EnableOutputProtection( |
| + uint64_t client_id, |
| + uint32_t desired_method_mask); |
| + |
| private: |
| // Configure outputs. |
| void ConfigureOutputs(); |