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 #include "remoting/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (message.type() == "test-echo") { | 192 if (message.type() == "test-echo") { |
193 protocol::ExtensionMessage reply; | 193 protocol::ExtensionMessage reply; |
194 reply.set_type("test-echo-reply"); | 194 reply.set_type("test-echo-reply"); |
195 if (message.has_data()) | 195 if (message.has_data()) |
196 reply.set_data(message.data().substr(0, 16)); | 196 reply.set_data(message.data().substr(0, 16)); |
197 connection_->client_stub()->DeliverHostMessage(reply); | 197 connection_->client_stub()->DeliverHostMessage(reply); |
198 return; | 198 return; |
199 } | 199 } |
200 } | 200 } |
201 // No messages are currently supported. | 201 // No messages are currently supported. |
202 LOG(INFO) << "Unexpected message received: " | 202 LOG(WARNING) << "Unexpected message received: " |
203 << message.type() << ": " << message.data(); | 203 << message.type() << ": " << message.data(); |
204 } | 204 } |
205 | 205 |
206 void ClientSession::OnConnectionAuthenticated( | 206 void ClientSession::OnConnectionAuthenticated( |
207 protocol::ConnectionToClient* connection) { | 207 protocol::ConnectionToClient* connection) { |
208 DCHECK(CalledOnValidThread()); | 208 DCHECK(CalledOnValidThread()); |
209 DCHECK_EQ(connection_.get(), connection); | 209 DCHECK_EQ(connection_.get(), connection); |
210 DCHECK(!audio_scheduler_.get()); | 210 DCHECK(!audio_scheduler_.get()); |
211 DCHECK(!desktop_environment_); | 211 DCHECK(!desktop_environment_); |
212 DCHECK(!input_injector_); | 212 DCHECK(!input_injector_); |
213 DCHECK(!screen_controls_); | 213 DCHECK(!screen_controls_); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Create a VideoEncoder based on the session's video channel configuration. | 265 // Create a VideoEncoder based on the session's video channel configuration. |
266 scoped_ptr<VideoEncoder> video_encoder = | 266 scoped_ptr<VideoEncoder> video_encoder = |
267 CreateVideoEncoder(connection_->session()->config()); | 267 CreateVideoEncoder(connection_->session()->config()); |
268 | 268 |
269 // Create a VideoScheduler to pump frames from the capturer to the client. | 269 // Create a VideoScheduler to pump frames from the capturer to the client. |
270 video_scheduler_ = new VideoScheduler( | 270 video_scheduler_ = new VideoScheduler( |
271 video_capture_task_runner_, | 271 video_capture_task_runner_, |
272 video_encode_task_runner_, | 272 video_encode_task_runner_, |
273 network_task_runner_, | 273 network_task_runner_, |
274 desktop_environment_->CreateVideoCapturer(), | 274 desktop_environment_->CreateVideoCapturer(), |
| 275 desktop_environment_->CreateMouseCursorMonitor(), |
275 video_encoder.Pass(), | 276 video_encoder.Pass(), |
276 connection_->client_stub(), | 277 connection_->client_stub(), |
277 &mouse_clamping_filter_); | 278 &mouse_clamping_filter_); |
278 | 279 |
279 // Create an AudioScheduler if audio is enabled, to pump audio samples. | 280 // Create an AudioScheduler if audio is enabled, to pump audio samples. |
280 if (connection_->session()->config().is_audio_enabled()) { | 281 if (connection_->session()->config().is_audio_enabled()) { |
281 scoped_ptr<AudioEncoder> audio_encoder = | 282 scoped_ptr<AudioEncoder> audio_encoder = |
282 CreateAudioEncoder(connection_->session()->config()); | 283 CreateAudioEncoder(connection_->session()->config()); |
283 audio_scheduler_ = new AudioScheduler( | 284 audio_scheduler_ = new AudioScheduler( |
284 audio_task_runner_, | 285 audio_task_runner_, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 444 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
444 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 445 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
445 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 446 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
446 } | 447 } |
447 | 448 |
448 NOTREACHED(); | 449 NOTREACHED(); |
449 return scoped_ptr<AudioEncoder>(); | 450 return scoped_ptr<AudioEncoder>(); |
450 } | 451 } |
451 | 452 |
452 } // namespace remoting | 453 } // namespace remoting |
OLD | NEW |