OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 5 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "chromeos/display/output_configurator.h" | 13 #include "chromeos/display/output_configurator.h" |
| 14 #include "ppapi/c/private/ppb_output_protection_private.h" |
13 | 15 |
14 typedef XID Window; | 16 typedef XID Window; |
15 | 17 |
16 struct _XDisplay; | 18 struct _XDisplay; |
17 typedef struct _XDisplay Display; | 19 typedef struct _XDisplay Display; |
18 struct _XRROutputInfo; | 20 struct _XRROutputInfo; |
19 typedef _XRROutputInfo XRROutputInfo; | 21 typedef _XRROutputInfo XRROutputInfo; |
20 struct _XRRScreenResources; | 22 struct _XRRScreenResources; |
21 typedef _XRRScreenResources XRRScreenResources; | 23 typedef _XRRScreenResources XRRScreenResources; |
22 | 24 |
(...skipping 23 matching lines...) Expand all Loading... |
46 int x, | 48 int x, |
47 int y) OVERRIDE; | 49 int y) OVERRIDE; |
48 virtual void CreateFrameBuffer( | 50 virtual void CreateFrameBuffer( |
49 int width, | 51 int width, |
50 int height, | 52 int height, |
51 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; | 53 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; |
52 virtual void ConfigureCTM( | 54 virtual void ConfigureCTM( |
53 int touch_device_id, | 55 int touch_device_id, |
54 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; | 56 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; |
55 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; | 57 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; |
| 58 virtual bool QueryOutputProtectionStatus( |
| 59 const void* client, |
| 60 uint32_t* link_mask, |
| 61 uint32_t* protection_mask) OVERRIDE; |
| 62 virtual bool EnableOutputProtection( |
| 63 const void* client, |
| 64 uint32_t desired_method_mask) OVERRIDE; |
56 | 65 |
57 private: | 66 private: |
| 67 // Mapping a client to its protection request bitmask. |
| 68 typedef std::map<const void*, uint32_t> ProtectionRequests; |
| 69 |
| 70 enum HDCPState { |
| 71 HDCP_State_Undesired, |
| 72 HDCP_State_Desired, |
| 73 HDCP_State_Enabled |
| 74 }; |
| 75 |
58 // Gets details corresponding to |mode|. Parameters may be NULL. Returns | 76 // Gets details corresponding to |mode|. Parameters may be NULL. Returns |
59 // true on success. | 77 // true on success. |
60 bool GetModeDetails(RRMode mode, int* width, int* height, bool* interlaced); | 78 bool GetModeDetails(RRMode mode, int* width, int* height, bool* interlaced); |
61 | 79 |
62 // Helper method for GetOutputs() that returns an OutputSnapshot struct based | 80 // Helper method for GetOutputs() that returns an OutputSnapshot struct based |
63 // on the passed-in information. Further initialization is required (e.g. | 81 // on the passed-in information. Further initialization is required (e.g. |
64 // |selected_mode|, |mirror_mode|, and |touch_device_id|). | 82 // |selected_mode|, |mirror_mode|, and |touch_device_id|). |
65 OutputConfigurator::OutputSnapshot InitOutputSnapshot( | 83 OutputConfigurator::OutputSnapshot InitOutputSnapshot( |
66 RROutput id, | 84 RROutput id, |
67 XRROutputInfo* info, | 85 XRROutputInfo* info, |
(...skipping 30 matching lines...) Expand all Loading... |
98 RRMode* external_mirror_mode); | 116 RRMode* external_mirror_mode); |
99 | 117 |
100 // Searches for touchscreens among input devices, | 118 // Searches for touchscreens among input devices, |
101 // and tries to match them up to screens in |outputs|. | 119 // and tries to match them up to screens in |outputs|. |
102 // |outputs| is an array of detected screens. | 120 // |outputs| is an array of detected screens. |
103 // If a touchscreen with same resolution as an output's native mode | 121 // If a touchscreen with same resolution as an output's native mode |
104 // is detected, its id will be stored in this output. | 122 // is detected, its id will be stored in this output. |
105 void GetTouchscreens( | 123 void GetTouchscreens( |
106 std::vector<OutputConfigurator::OutputSnapshot>* outputs); | 124 std::vector<OutputConfigurator::OutputSnapshot>* outputs); |
107 | 125 |
| 126 // Get HDCP state of output. |
| 127 bool GetHDCPState(RROutput id, HDCPState* state); |
| 128 // Set HDCP state of output. |
| 129 bool SetHDCPState(RROutput id, HDCPState state); |
| 130 // Query output protection link type of output. |
| 131 bool QueryOutputProtectionLinkType( |
| 132 RROutput id, |
| 133 PP_OutputProtectionLinkType_Private *link_type); |
| 134 |
108 Display* display_; | 135 Display* display_; |
109 Window window_; | 136 Window window_; |
110 | 137 |
111 // Initialized when the server is grabbed and freed when it's ungrabbed. | 138 // Initialized when the server is grabbed and freed when it's ungrabbed. |
112 XRRScreenResources* screen_; | 139 XRRScreenResources* screen_; |
113 | 140 |
114 // Used to enable modes which rely on panel fitting. | 141 // Used to enable modes which rely on panel fitting. |
115 bool is_panel_fitting_enabled_; | 142 bool is_panel_fitting_enabled_; |
116 | 143 |
| 144 // Output protection requests of each client. |
| 145 ProtectionRequests client_protection_requests_; |
| 146 |
117 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); | 147 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); |
118 }; | 148 }; |
119 | 149 |
120 } // namespace chromeos | 150 } // namespace chromeos |
121 | 151 |
122 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 152 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
OLD | NEW |