Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2653)

Unified Diff: chromeos/display/output_configurator.h

Issue 24039002: Pepper API implementation for output protection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: revise output configurator related code. rebased. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index 2ff4484a0e66e0acb83287a5d5c543090bab7c26..6260f23f66e1d4ab7c230cb985d49e01de0189b1 100644
--- a/chromeos/display/output_configurator.h
+++ b/chromeos/display/output_configurator.h
@@ -36,12 +36,31 @@ enum OutputState {
STATE_DUAL_EXTENDED,
};
+// Video output types.
+enum OutputType {
+ OUTPUT_TYPE_NONE = 0,
+ OUTPUT_TYPE_UNKNOWN = 1 << 0,
+ OUTPUT_TYPE_INTERNAL = 1 << 1,
+ OUTPUT_TYPE_VGA = 1 << 2,
+ OUTPUT_TYPE_HDMI = 1 << 3,
+ OUTPUT_TYPE_DVI = 1 << 4,
+ OUTPUT_TYPE_DISPLAYPORT = 1 << 5,
+};
+
+// Content protection methods applied on video output.
+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
: public base::MessageLoop::Dispatcher,
public base::MessagePumpObserver {
public:
+ typedef uint64_t OutputProtectionClientId;
+
struct ModeInfo {
ModeInfo();
ModeInfo(int width, int height, bool interlaced, float refresh_rate);
@@ -222,6 +241,18 @@ 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;
+
+ // Query link status and protection status. Returns true on success.
Daniel Erat 2013/09/20 15:00:24 nit: s/Query/Queries/
kcwu 2013/09/23 18:00:02 Done.
+ virtual bool QueryOutputProtectionStatus(
+ OutputProtectionClientId client_id,
+ uint32_t* link_mask,
+ uint32_t* protection_mask) = 0;
+
+ // Request the desired protection methods. Returns true when the protection
Daniel Erat 2013/09/20 15:00:24 nit: s/Request/Requests/
kcwu 2013/09/23 18:00:02 Done.
+ // request has been made.
+ virtual bool EnableOutputProtection(
+ OutputProtectionClientId client_id,
+ uint32_t desired_method_mask) = 0;
Daniel Erat 2013/09/20 15:00:24 you said that this matches the naming in the idl f
kcwu 2013/09/23 18:00:02 Done.
};
// Helper class used by tests.
@@ -358,6 +389,31 @@ class CHROMEOS_EXPORT OutputConfigurator
// so that time-consuming ConfigureOutputs() won't be called multiple times.
void ScheduleConfigureOutputs();
+ // Registers a client for output protection and request a client id. Returns
Daniel Erat 2013/09/20 15:00:24 nit: s/request/requests/
kcwu 2013/09/23 18:00:02 Done.
+ // 0 if requesting failed.
+ OutputProtectionClientId RegisterOutputProtectionClient();
+
+ // Unregisters the client.
+ void UnregisterOutputProtectionClient(OutputProtectionClientId client_id);
+
+ // Queries link status and protection status.
+ // |link_mask| is the type of connected output links, which is a bitmask of
+ // OutputType values. |protection_mask| is the desired protection methods,
+ // which is a bitmask of the OutputProtectionMethod values.
+ // Returns true on success.
+ bool QueryOutputProtectionStatus(
+ OutputProtectionClientId client_id,
+ uint32_t* link_mask,
+ uint32_t* protection_mask);
+
+ // Requests the desired protection methods.
+ // |protection_mask| is the desired protection methods, which is a bitmask
+ // of the PP_OutputProtectionMethod_Private values.
Daniel Erat 2013/09/20 15:00:24 s/PP_OutputProtectionMethod_Private/OutputProtecti
kcwu 2013/09/23 18:00:02 Done.
kcwu 2013/09/23 18:00:02 Done.
+ // Returns true when the protection request has been made.
+ bool EnableOutputProtection(
+ OutputProtectionClientId client_id,
+ uint32_t desired_method_mask);
Daniel Erat 2013/09/20 15:00:24 s/method/protection/ here too
kcwu 2013/09/23 18:00:02 Done.
+
private:
// Returns currently-connected outputs. This method is a wrapper around
// |delegate_->GetOutputs()| that does additional work, like finding the
@@ -463,6 +519,9 @@ class CHROMEOS_EXPORT OutputConfigurator
// Dispatch().
scoped_ptr<base::OneShotTimer<OutputConfigurator> > configure_timer_;
+ // Id for next output protection client.
+ OutputProtectionClientId next_output_protection_client_id_;
+
DISALLOW_COPY_AND_ASSIGN(OutputConfigurator);
};

Powered by Google App Engine
This is Rietveld 408576698