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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 void ClientSession::CreateVideoStreams( | 287 void ClientSession::CreateVideoStreams( |
288 protocol::ConnectionToClient* connection) { | 288 protocol::ConnectionToClient* connection) { |
289 DCHECK(CalledOnValidThread()); | 289 DCHECK(CalledOnValidThread()); |
290 DCHECK_EQ(connection_.get(), connection); | 290 DCHECK_EQ(connection_.get(), connection); |
291 | 291 |
292 // Create a VideoStream to pump frames from the capturer to the client. | 292 // Create a VideoStream to pump frames from the capturer to the client. |
293 video_stream_ = connection_->StartVideoStream( | 293 video_stream_ = connection_->StartVideoStream( |
294 desktop_environment_->CreateVideoCapturer()); | 294 desktop_environment_->CreateVideoCapturer()); |
295 | 295 |
296 video_stream_->SetSizeCallback( | 296 video_stream_->SetObserver(this); |
297 base::Bind(&ClientSession::OnScreenSizeChanged, base::Unretained(this))); | |
298 | 297 |
299 // Apply video-control parameters to the new stream. | 298 // Apply video-control parameters to the new stream. |
300 video_stream_->SetLosslessEncode(lossless_video_encode_); | 299 video_stream_->SetLosslessEncode(lossless_video_encode_); |
301 video_stream_->SetLosslessColor(lossless_video_color_); | 300 video_stream_->SetLosslessColor(lossless_video_color_); |
302 | 301 |
303 // Pause capturing if necessary. | 302 // Pause capturing if necessary. |
304 video_stream_->Pause(pause_video_); | 303 video_stream_->Pause(pause_video_); |
305 } | 304 } |
306 | 305 |
307 void ClientSession::OnConnectionChannelsConnected( | 306 void ClientSession::OnConnectionChannelsConnected( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 426 } |
428 | 427 |
429 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 428 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
430 DCHECK(CalledOnValidThread()); | 429 DCHECK(CalledOnValidThread()); |
431 | 430 |
432 return base::WrapUnique( | 431 return base::WrapUnique( |
433 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), | 432 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), |
434 base::ThreadTaskRunnerHandle::Get())); | 433 base::ThreadTaskRunnerHandle::Get())); |
435 } | 434 } |
436 | 435 |
437 void ClientSession::OnScreenSizeChanged(const webrtc::DesktopSize& size, | 436 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, |
438 const webrtc::DesktopVector& dpi) { | 437 const webrtc::DesktopSize& size, |
| 438 const webrtc::DesktopVector& dpi) { |
439 DCHECK(CalledOnValidThread()); | 439 DCHECK(CalledOnValidThread()); |
440 | 440 |
441 mouse_clamping_filter_.set_output_size(size); | 441 mouse_clamping_filter_.set_output_size(size); |
442 | 442 |
443 switch (connection_->session()->config().protocol()) { | 443 switch (connection_->session()->config().protocol()) { |
444 case protocol::SessionConfig::Protocol::ICE: | 444 case protocol::SessionConfig::Protocol::ICE: |
445 mouse_clamping_filter_.set_input_size(size); | 445 mouse_clamping_filter_.set_input_size(size); |
446 break; | 446 break; |
447 | 447 |
448 case protocol::SessionConfig::Protocol::WEBRTC: { | 448 case protocol::SessionConfig::Protocol::WEBRTC: { |
(...skipping 20 matching lines...) Expand all Loading... |
469 if (channels_connected_) { | 469 if (channels_connected_) { |
470 connection_->client_stub()->SetVideoLayout(layout); | 470 connection_->client_stub()->SetVideoLayout(layout); |
471 } else { | 471 } else { |
472 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); | 472 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); |
473 } | 473 } |
474 break; | 474 break; |
475 } | 475 } |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
| 479 void ClientSession::OnVideoFrameSent(protocol::VideoStream* stream, |
| 480 uint32_t frame_id, |
| 481 int64_t input_event_timestamp) { |
| 482 // TODO(sergeyu): Send a message to the client to notify about the new frame. |
| 483 } |
| 484 |
479 } // namespace remoting | 485 } // namespace remoting |
OLD | NEW |