Chromium Code Reviews| Index: remoting/host/client_session.cc |
| diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc |
| index 55e4decc1ca3bb70e29df4836cd787e0f1fbed1c..b0c72bbde60f1b4565eca55e170036ff739a60ec 100644 |
| --- a/remoting/host/client_session.cc |
| +++ b/remoting/host/client_session.cc |
| @@ -67,7 +67,8 @@ ClientSession::ClientSession( |
| video_encode_task_runner_(video_encode_task_runner), |
| network_task_runner_(network_task_runner), |
| ui_task_runner_(ui_task_runner), |
| - pairing_registry_(pairing_registry) { |
| + pairing_registry_(pairing_registry), |
| + enable_cast_(false) { |
| connection_->SetEventHandler(this); |
| // TODO(sergeyu): Currently ConnectionToClient expects stubs to be |
| @@ -318,7 +319,6 @@ void ClientSession::OnConnectionAuthenticated( |
| scoped_ptr<VideoEncoder> video_encoder = |
| CreateVideoEncoder(connection_->session()->config()); |
| - // Create a VideoScheduler to pump frames from the capturer to the client. |
| video_scheduler_ = new VideoScheduler( |
| video_capture_task_runner_, |
| video_encode_task_runner_, |
| @@ -481,6 +481,26 @@ scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| base::MessageLoopProxy::current())); |
| } |
| +scoped_ptr<webrtc::ScreenCapturer> ClientSession::RequestScreenCapturer() { |
| + // VideoScheduler must be stopped on one of these threads. |
| + DCHECK(video_capture_task_runner_->BelongsToCurrentThread() || |
| + network_task_runner_->BelongsToCurrentThread()); |
| + |
| + if(!enable_cast_) { |
|
Sergey Ulanov
2014/07/24 19:11:36
I still think you don't need this flag. RequestScr
aiguha
2014/07/28 17:11:56
Acknowledged.
|
| + LOG(ERROR) << "Cast mode not enabled."; |
| + return scoped_ptr<webrtc::ScreenCapturer>(); |
| + } |
| + |
| + if (!video_scheduler_.get()) { |
| + LOG(ERROR) << "Video Scheduler was NULL, but shouldn't have been."; |
| + return scoped_ptr<webrtc::ScreenCapturer>(); |
| + } |
| + |
| + video_scheduler_->Stop(); |
| + |
| + return desktop_environment_->CreateVideoCapturer(); |
|
aiguha
2014/07/18 21:30:37
As of now, this method is called on the network th
|
| +} |
| + |
| // TODO(sergeyu): Move this to SessionManager? |
| // static |
| scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( |