| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 | 289 |
| 290 video_stream_->SetObserver(this); | 290 video_stream_->SetObserver(this); |
| 291 | 291 |
| 292 // Apply video-control parameters to the new stream. | 292 // Apply video-control parameters to the new stream. |
| 293 video_stream_->SetLosslessEncode(lossless_video_encode_); | 293 video_stream_->SetLosslessEncode(lossless_video_encode_); |
| 294 video_stream_->SetLosslessColor(lossless_video_color_); | 294 video_stream_->SetLosslessColor(lossless_video_color_); |
| 295 | 295 |
| 296 // Pause capturing if necessary. | 296 // Pause capturing if necessary. |
| 297 video_stream_->Pause(pause_video_); | 297 video_stream_->Pause(pause_video_); |
| 298 |
| 299 if (event_timestamp_source_for_tests_) |
| 300 video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_); |
| 298 } | 301 } |
| 299 | 302 |
| 300 void ClientSession::OnConnectionChannelsConnected() { | 303 void ClientSession::OnConnectionChannelsConnected() { |
| 301 DCHECK(CalledOnValidThread()); | 304 DCHECK(CalledOnValidThread()); |
| 302 | 305 |
| 303 DCHECK(!channels_connected_); | 306 DCHECK(!channels_connected_); |
| 304 channels_connected_ = true; | 307 channels_connected_ = true; |
| 305 | 308 |
| 306 // Negotiate capabilities with the client. | 309 // Negotiate capabilities with the client. |
| 307 VLOG(1) << "Host capabilities: " << host_capabilities_; | 310 VLOG(1) << "Host capabilities: " << host_capabilities_; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 DCHECK(CalledOnValidThread()); | 400 DCHECK(CalledOnValidThread()); |
| 398 DCHECK(desktop_environment_); | 401 DCHECK(desktop_environment_); |
| 399 return desktop_environment_->GetDesktopSessionId(); | 402 return desktop_environment_->GetDesktopSessionId(); |
| 400 } | 403 } |
| 401 | 404 |
| 402 ClientSessionControl* ClientSession::session_control() { | 405 ClientSessionControl* ClientSession::session_control() { |
| 403 DCHECK(CalledOnValidThread()); | 406 DCHECK(CalledOnValidThread()); |
| 404 return this; | 407 return this; |
| 405 } | 408 } |
| 406 | 409 |
| 410 void ClientSession::SetEventTimestampsSourceForTests( |
| 411 scoped_refptr<protocol::InputEventTimestampsSource> |
| 412 event_timestamp_source) { |
| 413 DCHECK(CalledOnValidThread()); |
| 414 event_timestamp_source_for_tests_ = event_timestamp_source; |
| 415 if (video_stream_) |
| 416 video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_); |
| 417 } |
| 418 |
| 407 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 419 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| 408 DCHECK(CalledOnValidThread()); | 420 DCHECK(CalledOnValidThread()); |
| 409 | |
| 410 return base::MakeUnique<protocol::ClipboardThreadProxy>( | 421 return base::MakeUnique<protocol::ClipboardThreadProxy>( |
| 411 client_clipboard_factory_.GetWeakPtr(), | 422 client_clipboard_factory_.GetWeakPtr(), |
| 412 base::ThreadTaskRunnerHandle::Get()); | 423 base::ThreadTaskRunnerHandle::Get()); |
| 413 } | 424 } |
| 414 | 425 |
| 415 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, | 426 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, |
| 416 const webrtc::DesktopSize& size, | 427 const webrtc::DesktopSize& size, |
| 417 const webrtc::DesktopVector& dpi) { | 428 const webrtc::DesktopVector& dpi) { |
| 418 DCHECK(CalledOnValidThread()); | 429 DCHECK(CalledOnValidThread()); |
| 419 | 430 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 449 connection_->client_stub()->SetVideoLayout(layout); | 460 connection_->client_stub()->SetVideoLayout(layout); |
| 450 } else { | 461 } else { |
| 451 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); | 462 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); |
| 452 } | 463 } |
| 453 break; | 464 break; |
| 454 } | 465 } |
| 455 } | 466 } |
| 456 } | 467 } |
| 457 | 468 |
| 458 } // namespace remoting | 469 } // namespace remoting |
| OLD | NEW |