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