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 <cstdint> | 8 #include <cstdint> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "remoting/protocol/pairing_registry.h" | 32 #include "remoting/protocol/pairing_registry.h" |
33 #include "remoting/protocol/video_stream.h" | 33 #include "remoting/protocol/video_stream.h" |
34 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 34 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
35 | 35 |
36 namespace base { | 36 namespace base { |
37 class SingleThreadTaskRunner; | 37 class SingleThreadTaskRunner; |
38 } // namespace base | 38 } // namespace base |
39 | 39 |
40 namespace remoting { | 40 namespace remoting { |
41 | 41 |
42 class AudioPump; | 42 class AudioSendStream; |
43 class DesktopEnvironment; | 43 class DesktopEnvironment; |
44 class DesktopEnvironmentFactory; | 44 class DesktopEnvironmentFactory; |
45 class InputInjector; | 45 class InputInjector; |
46 class MouseShapePump; | 46 class MouseShapePump; |
47 class ScreenControls; | 47 class ScreenControls; |
48 | 48 |
49 namespace protocol { | 49 namespace protocol { |
50 class VideoLayout; | 50 class VideoLayout; |
51 } // namespace protocol | 51 } // namespace protocol |
52 | 52 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const std::string& channel_name, | 86 const std::string& channel_name, |
87 const protocol::TransportRoute& route) = 0; | 87 const protocol::TransportRoute& route) = 0; |
88 | 88 |
89 protected: | 89 protected: |
90 virtual ~EventHandler() {} | 90 virtual ~EventHandler() {} |
91 }; | 91 }; |
92 | 92 |
93 // |event_handler| and |desktop_environment_factory| must outlive |this|. | 93 // |event_handler| and |desktop_environment_factory| must outlive |this|. |
94 // All |HostExtension|s in |extensions| must outlive |this|. | 94 // All |HostExtension|s in |extensions| must outlive |this|. |
95 ClientSession(EventHandler* event_handler, | 95 ClientSession(EventHandler* event_handler, |
96 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | |
97 std::unique_ptr<protocol::ConnectionToClient> connection, | 96 std::unique_ptr<protocol::ConnectionToClient> connection, |
98 DesktopEnvironmentFactory* desktop_environment_factory, | 97 DesktopEnvironmentFactory* desktop_environment_factory, |
99 const base::TimeDelta& max_duration, | 98 const base::TimeDelta& max_duration, |
100 scoped_refptr<protocol::PairingRegistry> pairing_registry, | 99 scoped_refptr<protocol::PairingRegistry> pairing_registry, |
101 const std::vector<HostExtension*>& extensions); | 100 const std::vector<HostExtension*>& extensions); |
102 ~ClientSession() override; | 101 ~ClientSession() override; |
103 | 102 |
104 // Returns the set of capabilities negotiated between client and host. | 103 // Returns the set of capabilities negotiated between client and host. |
105 const std::string& capabilities() const { return capabilities_; } | 104 const std::string& capabilities() const { return capabilities_; } |
106 | 105 |
107 // protocol::HostStub interface. | 106 // protocol::HostStub interface. |
108 void NotifyClientResolution( | 107 void NotifyClientResolution( |
109 const protocol::ClientResolution& resolution) override; | 108 const protocol::ClientResolution& resolution) override; |
110 void ControlVideo(const protocol::VideoControl& video_control) override; | 109 void ControlVideo(const protocol::VideoControl& video_control) override; |
111 void ControlAudio(const protocol::AudioControl& audio_control) override; | 110 void ControlAudio(const protocol::AudioControl& audio_control) override; |
112 void SetCapabilities(const protocol::Capabilities& capabilities) override; | 111 void SetCapabilities(const protocol::Capabilities& capabilities) override; |
113 void RequestPairing( | 112 void RequestPairing( |
114 const remoting::protocol::PairingRequest& pairing_request) override; | 113 const remoting::protocol::PairingRequest& pairing_request) override; |
115 void DeliverClientMessage(const protocol::ExtensionMessage& message) override; | 114 void DeliverClientMessage(const protocol::ExtensionMessage& message) override; |
116 | 115 |
117 // protocol::ConnectionToClient::EventHandler interface. | 116 // protocol::ConnectionToClient::EventHandler interface. |
118 void OnConnectionAuthenticating( | 117 void OnConnectionAuthenticating( |
119 protocol::ConnectionToClient* connection) override; | 118 protocol::ConnectionToClient* connection) override; |
120 void OnConnectionAuthenticated( | 119 void OnConnectionAuthenticated( |
121 protocol::ConnectionToClient* connection) override; | 120 protocol::ConnectionToClient* connection) override; |
122 void CreateVideoStreams(protocol::ConnectionToClient* connection) override; | 121 void CreateMediaStreams(protocol::ConnectionToClient* connection) override; |
123 void OnConnectionChannelsConnected( | 122 void OnConnectionChannelsConnected( |
124 protocol::ConnectionToClient* connection) override; | 123 protocol::ConnectionToClient* connection) override; |
125 void OnConnectionClosed(protocol::ConnectionToClient* connection, | 124 void OnConnectionClosed(protocol::ConnectionToClient* connection, |
126 protocol::ErrorCode error) override; | 125 protocol::ErrorCode error) override; |
127 void OnInputEventReceived(protocol::ConnectionToClient* connection, | 126 void OnInputEventReceived(protocol::ConnectionToClient* connection, |
128 int64_t timestamp) override; | 127 int64_t timestamp) override; |
129 void OnRouteChange(protocol::ConnectionToClient* connection, | 128 void OnRouteChange(protocol::ConnectionToClient* connection, |
130 const std::string& channel_name, | 129 const std::string& channel_name, |
131 const protocol::TransportRoute& route) override; | 130 const protocol::TransportRoute& route) override; |
132 | 131 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 base::WeakPtrFactory<protocol::ClipboardStub> client_clipboard_factory_; | 199 base::WeakPtrFactory<protocol::ClipboardStub> client_clipboard_factory_; |
201 | 200 |
202 // The maximum duration of this session. | 201 // The maximum duration of this session. |
203 // There is no maximum if this value is <= 0. | 202 // There is no maximum if this value is <= 0. |
204 base::TimeDelta max_duration_; | 203 base::TimeDelta max_duration_; |
205 | 204 |
206 // A timer that triggers a disconnect when the maximum session duration | 205 // A timer that triggers a disconnect when the maximum session duration |
207 // is reached. | 206 // is reached. |
208 base::OneShotTimer max_duration_timer_; | 207 base::OneShotTimer max_duration_timer_; |
209 | 208 |
210 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | |
211 | |
212 // Objects responsible for sending video, audio and mouse shape. | 209 // Objects responsible for sending video, audio and mouse shape. |
213 std::unique_ptr<AudioPump> audio_pump_; | |
214 std::unique_ptr<protocol::VideoStream> video_stream_; | 210 std::unique_ptr<protocol::VideoStream> video_stream_; |
| 211 std::unique_ptr<protocol::AudioSendStream> audio_stream_; |
215 std::unique_ptr<MouseShapePump> mouse_shape_pump_; | 212 std::unique_ptr<MouseShapePump> mouse_shape_pump_; |
216 | 213 |
217 // The set of all capabilities supported by the client. | 214 // The set of all capabilities supported by the client. |
218 std::unique_ptr<std::string> client_capabilities_; | 215 std::unique_ptr<std::string> client_capabilities_; |
219 | 216 |
220 // The set of all capabilities supported by the host. | 217 // The set of all capabilities supported by the host. |
221 std::string host_capabilities_; | 218 std::string host_capabilities_; |
222 | 219 |
223 // The set of all capabilities negotiated between client and host. | 220 // The set of all capabilities negotiated between client and host. |
224 std::string capabilities_; | 221 std::string capabilities_; |
(...skipping 28 matching lines...) Expand all Loading... |
253 // Used to disable callbacks to |this| once DisconnectSession() has been | 250 // Used to disable callbacks to |this| once DisconnectSession() has been |
254 // called. | 251 // called. |
255 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 252 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
256 | 253 |
257 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 254 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
258 }; | 255 }; |
259 | 256 |
260 } // namespace remoting | 257 } // namespace remoting |
261 | 258 |
262 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 259 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |