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

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: add test 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 5891785381cb22161e41415a98e62b8fd00679b1..556a1ac62836d9b3d7e9e5d69b727ea5f55179a7 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;
+} // 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.
+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,
+};
+
+// Content protection methods applied on video output link.
+enum OutputProtectionMethod {
+ OUTPUT_PROTECTION_METHOD_NONE,
+ OUTPUT_PROTECTION_METHOD_HDCP,
+};
+
// This class interacts directly with the underlying Xrandr API to manipulate
// CTRCs and Outputs.
class CHROMEOS_EXPORT OutputConfigurator
@@ -218,6 +239,20 @@ 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;
+
+ virtual uint64_t RegisterOutputProtectionClient() = 0;
+ virtual void UnregisterOutputProtectionClient(uint64_t client_id) = 0;
+ // 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;
};
// Helper class used by tests.
@@ -348,6 +383,27 @@ class CHROMEOS_EXPORT OutputConfigurator
// so that time-consuming ConfigureOutputs() won't be called multiple times.
void ScheduleConfigureOutputs();
+ uint64_t RegisterOutputProtectionClient();
+ 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.
+ // 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();

Powered by Google App Engine
This is Rietveld 408576698