| 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_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "media/video/capture/screen/screen_capturer.h" | 10 #include "media/video/capture/screen/screen_capturer.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 desktop_environment->CreateSessionController(client_jid_, this); | 169 desktop_environment->CreateSessionController(client_jid_, this); |
| 170 | 170 |
| 171 // Create and start the event executor. | 171 // Create and start the event executor. |
| 172 event_executor_ = desktop_environment->CreateEventExecutor(); | 172 event_executor_ = desktop_environment->CreateEventExecutor(); |
| 173 event_executor_->Start(CreateClipboardProxy()); | 173 event_executor_->Start(CreateClipboardProxy()); |
| 174 | 174 |
| 175 // Connect the host clipboard and input stubs. | 175 // Connect the host clipboard and input stubs. |
| 176 host_input_filter_.set_input_stub(event_executor_.get()); | 176 host_input_filter_.set_input_stub(event_executor_.get()); |
| 177 clipboard_echo_filter_.set_host_stub(event_executor_.get()); | 177 clipboard_echo_filter_.set_host_stub(event_executor_.get()); |
| 178 | 178 |
| 179 SetDisableInputs(false); | 179 PauseSession(false); |
| 180 | 180 |
| 181 // Create a VideoEncoder based on the session's video channel configuration. | 181 // Create a VideoEncoder based on the session's video channel configuration. |
| 182 scoped_ptr<VideoEncoder> video_encoder = | 182 scoped_ptr<VideoEncoder> video_encoder = |
| 183 CreateVideoEncoder(connection_->session()->config()); | 183 CreateVideoEncoder(connection_->session()->config()); |
| 184 | 184 |
| 185 // Create a VideoScheduler to pump frames from the capturer to the client. | 185 // Create a VideoScheduler to pump frames from the capturer to the client. |
| 186 video_scheduler_ = VideoScheduler::Create( | 186 video_scheduler_ = VideoScheduler::Create( |
| 187 video_capture_task_runner_, | 187 video_capture_task_runner_, |
| 188 video_encode_task_runner_, | 188 video_encode_task_runner_, |
| 189 network_task_runner_, | 189 network_task_runner_, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // This triggers OnConnectionClosed(), and the session may be destroyed | 276 // This triggers OnConnectionClosed(), and the session may be destroyed |
| 277 // as the result, so this call must be the last in this method. | 277 // as the result, so this call must be the last in this method. |
| 278 connection_->Disconnect(); | 278 connection_->Disconnect(); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void ClientSession::OnLocalMouseMoved(const SkIPoint& position) { | 281 void ClientSession::OnLocalMouseMoved(const SkIPoint& position) { |
| 282 DCHECK(CalledOnValidThread()); | 282 DCHECK(CalledOnValidThread()); |
| 283 remote_input_filter_.LocalMouseMoved(position); | 283 remote_input_filter_.LocalMouseMoved(position); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ClientSession::SetDisableInputs(bool disable_inputs) { | 286 void ClientSession::PauseSession(bool pause) { |
| 287 DCHECK(CalledOnValidThread()); | 287 DCHECK(CalledOnValidThread()); |
| 288 | 288 |
| 289 if (disable_inputs) | 289 if (pause) |
| 290 input_tracker_.ReleaseAll(); | 290 input_tracker_.ReleaseAll(); |
| 291 | 291 |
| 292 disable_input_filter_.set_enabled(!disable_inputs); | 292 disable_input_filter_.set_enabled(!pause); |
| 293 disable_clipboard_filter_.set_enabled(!disable_inputs); | 293 disable_clipboard_filter_.set_enabled(!pause); |
| 294 } | 294 } |
| 295 | 295 |
| 296 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 296 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| 297 DCHECK(CalledOnValidThread()); | 297 DCHECK(CalledOnValidThread()); |
| 298 | 298 |
| 299 return scoped_ptr<protocol::ClipboardStub>( | 299 return scoped_ptr<protocol::ClipboardStub>( |
| 300 new protocol::ClipboardThreadProxy( | 300 new protocol::ClipboardThreadProxy( |
| 301 client_clipboard_factory_.GetWeakPtr(), | 301 client_clipboard_factory_.GetWeakPtr(), |
| 302 base::MessageLoopProxy::current())); | 302 base::MessageLoopProxy::current())); |
| 303 } | 303 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 329 return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex()); | 329 return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex()); |
| 330 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 330 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
| 331 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 331 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
| 332 } | 332 } |
| 333 | 333 |
| 334 NOTIMPLEMENTED(); | 334 NOTIMPLEMENTED(); |
| 335 return scoped_ptr<AudioEncoder>(NULL); | 335 return scoped_ptr<AudioEncoder>(NULL); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace remoting | 338 } // namespace remoting |
| OLD | NEW |