| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 12 #include "remoting/base/capabilities.h" | 12 #include "remoting/base/capabilities.h" |
| 13 #include "remoting/base/logging.h" | 13 #include "remoting/base/logging.h" |
| 14 #include "remoting/codec/audio_encoder.h" | 14 #include "remoting/codec/audio_encoder.h" |
| 15 #include "remoting/codec/audio_encoder_opus.h" | 15 #include "remoting/codec/audio_encoder_opus.h" |
| 16 #include "remoting/codec/audio_encoder_verbatim.h" | 16 #include "remoting/codec/audio_encoder_verbatim.h" |
| 17 #include "remoting/codec/video_encoder.h" | 17 #include "remoting/codec/video_encoder.h" |
| 18 #include "remoting/codec/video_encoder_verbatim.h" | 18 #include "remoting/codec/video_encoder_verbatim.h" |
| 19 #include "remoting/codec/video_encoder_vpx.h" | 19 #include "remoting/codec/video_encoder_vpx.h" |
| 20 #include "remoting/host/audio_capturer.h" | 20 #include "remoting/host/audio_capturer.h" |
| 21 #include "remoting/host/audio_pump.h" | 21 #include "remoting/host/audio_pump.h" |
| 22 #include "remoting/host/desktop_capturer_proxy.h" | 22 #include "remoting/host/desktop_capturer_proxy.h" |
| 23 #include "remoting/host/desktop_environment.h" | 23 #include "remoting/host/desktop_environment.h" |
| 24 #include "remoting/host/host_extension_session.h" | 24 #include "remoting/host/host_extension_session.h" |
| 25 #include "remoting/host/input_injector.h" | 25 #include "remoting/host/input_injector.h" |
| 26 #include "remoting/host/mouse_shape_pump.h" | 26 #include "remoting/host/mouse_shape_pump.h" |
| 27 #include "remoting/host/screen_controls.h" | 27 #include "remoting/host/screen_controls.h" |
| 28 #include "remoting/host/screen_resolution.h" | 28 #include "remoting/host/screen_resolution.h" |
| 29 #include "remoting/host/video_frame_pump.h" | |
| 30 #include "remoting/proto/control.pb.h" | 29 #include "remoting/proto/control.pb.h" |
| 31 #include "remoting/proto/event.pb.h" | 30 #include "remoting/proto/event.pb.h" |
| 32 #include "remoting/protocol/client_stub.h" | 31 #include "remoting/protocol/client_stub.h" |
| 33 #include "remoting/protocol/clipboard_thread_proxy.h" | 32 #include "remoting/protocol/clipboard_thread_proxy.h" |
| 34 #include "remoting/protocol/pairing_registry.h" | 33 #include "remoting/protocol/pairing_registry.h" |
| 35 #include "remoting/protocol/session.h" | 34 #include "remoting/protocol/session.h" |
| 36 #include "remoting/protocol/session_config.h" | 35 #include "remoting/protocol/session_config.h" |
| 36 #include "remoting/protocol/video_frame_pump.h" |
| 37 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | 37 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 38 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 38 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
| 39 | 39 |
| 40 // Default DPI to assume for old clients that use notifyClientDimensions. | 40 // Default DPI to assume for old clients that use notifyClientDimensions. |
| 41 const int kDefaultDPI = 96; | 41 const int kDefaultDPI = 96; |
| 42 | 42 |
| 43 namespace remoting { | 43 namespace remoting { |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 new MouseShapePump(video_capture_task_runner_, | 480 new MouseShapePump(video_capture_task_runner_, |
| 481 desktop_environment_->CreateMouseCursorMonitor(), | 481 desktop_environment_->CreateMouseCursorMonitor(), |
| 482 connection_->client_stub())); | 482 connection_->client_stub())); |
| 483 | 483 |
| 484 // Create a VideoFramePump to pump frames from the capturer to the client.' | 484 // Create a VideoFramePump to pump frames from the capturer to the client.' |
| 485 // | 485 // |
| 486 // TODO(sergeyu): Move DesktopCapturerProxy creation to DesktopEnvironment. | 486 // TODO(sergeyu): Move DesktopCapturerProxy creation to DesktopEnvironment. |
| 487 // When using IpcDesktopCapturer the capture thread is not useful. | 487 // When using IpcDesktopCapturer the capture thread is not useful. |
| 488 scoped_ptr<DesktopCapturerProxy> capturer_proxy(new DesktopCapturerProxy( | 488 scoped_ptr<DesktopCapturerProxy> capturer_proxy(new DesktopCapturerProxy( |
| 489 video_capture_task_runner_, video_capturer.Pass())); | 489 video_capture_task_runner_, video_capturer.Pass())); |
| 490 video_frame_pump_.reset( | 490 video_frame_pump_.reset(new protocol::VideoFramePump( |
| 491 new VideoFramePump(video_encode_task_runner_, capturer_proxy.Pass(), | 491 video_encode_task_runner_, capturer_proxy.Pass(), video_encoder.Pass(), |
| 492 video_encoder.Pass(), &mouse_clamping_filter_)); | 492 &mouse_clamping_filter_)); |
| 493 | 493 |
| 494 // Apply video-control parameters to the new scheduler. | 494 // Apply video-control parameters to the new scheduler. |
| 495 video_frame_pump_->SetLosslessEncode(lossless_video_encode_); | 495 video_frame_pump_->SetLosslessEncode(lossless_video_encode_); |
| 496 video_frame_pump_->SetLosslessColor(lossless_video_color_); | 496 video_frame_pump_->SetLosslessColor(lossless_video_color_); |
| 497 | 497 |
| 498 // Pause capturing if necessary. | 498 // Pause capturing if necessary. |
| 499 video_frame_pump_->Pause(pause_video_); | 499 video_frame_pump_->Pause(pause_video_); |
| 500 | 500 |
| 501 connection_->set_video_feedback_stub( | 501 connection_->set_video_feedback_stub( |
| 502 video_frame_pump_->video_feedback_stub()); | 502 video_frame_pump_->video_feedback_stub()); |
| 503 } | 503 } |
| 504 | 504 |
| 505 void ClientSession::SetGnubbyAuthHandlerForTesting( | 505 void ClientSession::SetGnubbyAuthHandlerForTesting( |
| 506 GnubbyAuthHandler* gnubby_auth_handler) { | 506 GnubbyAuthHandler* gnubby_auth_handler) { |
| 507 DCHECK(CalledOnValidThread()); | 507 DCHECK(CalledOnValidThread()); |
| 508 gnubby_auth_handler_.reset(gnubby_auth_handler); | 508 gnubby_auth_handler_.reset(gnubby_auth_handler); |
| 509 } | 509 } |
| 510 | 510 |
| 511 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 511 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| 512 DCHECK(CalledOnValidThread()); | 512 DCHECK(CalledOnValidThread()); |
| 513 | 513 |
| 514 return make_scoped_ptr( | 514 return make_scoped_ptr( |
| 515 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), | 515 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), |
| 516 base::ThreadTaskRunnerHandle::Get())); | 516 base::ThreadTaskRunnerHandle::Get())); |
| 517 } | 517 } |
| 518 | 518 |
| 519 } // namespace remoting | 519 } // namespace remoting |
| OLD | NEW |