OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_HOST_CLIENT_SESSION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ |
6 #define REMOTING_HOST_CLIENT_SESSION_H_ | 6 #define REMOTING_HOST_CLIENT_SESSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "remoting/protocol/input_stub.h" | 28 #include "remoting/protocol/input_stub.h" |
29 #include "remoting/protocol/pairing_registry.h" | 29 #include "remoting/protocol/pairing_registry.h" |
30 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 30 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
31 | 31 |
32 namespace base { | 32 namespace base { |
33 class SingleThreadTaskRunner; | 33 class SingleThreadTaskRunner; |
34 } // namespace base | 34 } // namespace base |
35 | 35 |
36 namespace remoting { | 36 namespace remoting { |
37 | 37 |
38 class AudioEncoder; | 38 class AudioPump; |
39 class AudioScheduler; | |
40 class DesktopEnvironment; | 39 class DesktopEnvironment; |
41 class DesktopEnvironmentFactory; | 40 class DesktopEnvironmentFactory; |
42 class InputInjector; | 41 class InputInjector; |
43 class MouseShapePump; | 42 class MouseShapePump; |
44 class ScreenControls; | 43 class ScreenControls; |
45 class VideoEncoder; | |
46 class VideoFramePump; | 44 class VideoFramePump; |
47 | 45 |
48 // A ClientSession keeps a reference to a connection to a client, and maintains | 46 // A ClientSession keeps a reference to a connection to a client, and maintains |
49 // per-client state. | 47 // per-client state. |
50 class ClientSession | 48 class ClientSession |
51 : public base::NonThreadSafe, | 49 : public base::NonThreadSafe, |
52 public protocol::HostStub, | 50 public protocol::HostStub, |
53 public protocol::ConnectionToClient::EventHandler, | 51 public protocol::ConnectionToClient::EventHandler, |
54 public ClientSessionControl { | 52 public ClientSessionControl { |
55 public: | 53 public: |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 bool is_authenticated() { return auth_input_filter_.enabled(); } | 144 bool is_authenticated() { return auth_input_filter_.enabled(); } |
147 | 145 |
148 const std::string* client_capabilities() const { | 146 const std::string* client_capabilities() const { |
149 return client_capabilities_.get(); | 147 return client_capabilities_.get(); |
150 } | 148 } |
151 | 149 |
152 private: | 150 private: |
153 // Creates a proxy for sending clipboard events to the client. | 151 // Creates a proxy for sending clipboard events to the client. |
154 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); | 152 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); |
155 | 153 |
156 // Creates an audio encoder for the specified configuration. | |
157 static scoped_ptr<AudioEncoder> CreateAudioEncoder( | |
158 const protocol::SessionConfig& config); | |
159 | |
160 // Creates a video encoder for the specified configuration. | |
161 static scoped_ptr<VideoEncoder> CreateVideoEncoder( | |
162 const protocol::SessionConfig& config); | |
163 | |
164 EventHandler* event_handler_; | 154 EventHandler* event_handler_; |
165 | 155 |
166 // The connection to the client. | 156 // The connection to the client. |
167 scoped_ptr<protocol::ConnectionToClient> connection_; | 157 scoped_ptr<protocol::ConnectionToClient> connection_; |
168 | 158 |
169 std::string client_jid_; | 159 std::string client_jid_; |
170 | 160 |
171 // Used to create a DesktopEnvironment instance for this session. | 161 // Used to create a DesktopEnvironment instance for this session. |
172 DesktopEnvironmentFactory* desktop_environment_factory_; | 162 DesktopEnvironmentFactory* desktop_environment_factory_; |
173 | 163 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // is reached. | 202 // is reached. |
213 base::OneShotTimer<ClientSession> max_duration_timer_; | 203 base::OneShotTimer<ClientSession> max_duration_timer_; |
214 | 204 |
215 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 205 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
216 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 206 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
217 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; | 207 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; |
218 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; | 208 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; |
219 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 209 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
220 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 210 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
221 | 211 |
222 // Schedulers for audio and video capture. | 212 // Pumps for audio, video and mouse shape. |
223 // |video_frame_pump_| may be nullptr if the video channel is not required - | 213 // |video_frame_pump_| and |mouse_shape_pump_| may be nullptr if the video |
224 // see ResetVideoPipeline(). | 214 // stream is handled by an extension, see ResetVideoPipeline(). |
225 scoped_refptr<AudioScheduler> audio_scheduler_; | 215 scoped_ptr<AudioPump> audio_pump_; |
226 scoped_ptr<VideoFramePump> video_frame_pump_; | 216 scoped_ptr<VideoFramePump> video_frame_pump_; |
227 scoped_ptr<MouseShapePump> mouse_shape_pump_; | 217 scoped_ptr<MouseShapePump> mouse_shape_pump_; |
228 | 218 |
229 // The set of all capabilities supported by the client. | 219 // The set of all capabilities supported by the client. |
230 scoped_ptr<std::string> client_capabilities_; | 220 scoped_ptr<std::string> client_capabilities_; |
231 | 221 |
232 // The set of all capabilities supported by the host. | 222 // The set of all capabilities supported by the host. |
233 std::string host_capabilities_; | 223 std::string host_capabilities_; |
234 | 224 |
235 // The set of all capabilities negotiated between client and host. | 225 // The set of all capabilities negotiated between client and host. |
(...skipping 22 matching lines...) Expand all Loading... |
258 // Used to disable callbacks to |this| once DisconnectSession() has been | 248 // Used to disable callbacks to |this| once DisconnectSession() has been |
259 // called. | 249 // called. |
260 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 250 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
261 | 251 |
262 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 252 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
263 }; | 253 }; |
264 | 254 |
265 } // namespace remoting | 255 } // namespace remoting |
266 | 256 |
267 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 257 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |