| 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/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 11 #include "remoting/base/capabilities.h" | 12 #include "remoting/base/capabilities.h" |
| 12 #include "remoting/base/logging.h" | 13 #include "remoting/base/logging.h" |
| 13 #include "remoting/codec/audio_encoder.h" | 14 #include "remoting/codec/audio_encoder.h" |
| 14 #include "remoting/codec/audio_encoder_opus.h" | 15 #include "remoting/codec/audio_encoder_opus.h" |
| 15 #include "remoting/codec/audio_encoder_verbatim.h" | 16 #include "remoting/codec/audio_encoder_verbatim.h" |
| 16 #include "remoting/codec/video_encoder.h" | 17 #include "remoting/codec/video_encoder.h" |
| 17 #include "remoting/codec/video_encoder_verbatim.h" | 18 #include "remoting/codec/video_encoder_verbatim.h" |
| 18 #include "remoting/codec/video_encoder_vpx.h" | 19 #include "remoting/codec/video_encoder_vpx.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | 35 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 35 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 36 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
| 36 | 37 |
| 37 // Default DPI to assume for old clients that use notifyClientDimensions. | 38 // Default DPI to assume for old clients that use notifyClientDimensions. |
| 38 const int kDefaultDPI = 96; | 39 const int kDefaultDPI = 96; |
| 39 | 40 |
| 40 namespace remoting { | 41 namespace remoting { |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| 45 // Name of command-line flag to enable VP9 to use I444 by default. |
| 46 const char kEnableI444SwitchName[] = "enable-i444"; |
| 47 |
| 44 scoped_ptr<VideoEncoder> CreateVideoEncoder( | 48 scoped_ptr<VideoEncoder> CreateVideoEncoder( |
| 45 const protocol::SessionConfig& config) { | 49 const protocol::SessionConfig& config) { |
| 46 const protocol::ChannelConfig& video_config = config.video_config(); | 50 const protocol::ChannelConfig& video_config = config.video_config(); |
| 47 | 51 |
| 48 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | 52 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { |
| 49 return VideoEncoderVpx::CreateForVP8().Pass(); | 53 return VideoEncoderVpx::CreateForVP8().Pass(); |
| 50 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { | 54 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { |
| 51 return VideoEncoderVpx::CreateForVP9().Pass(); | 55 return VideoEncoderVpx::CreateForVP9().Pass(); |
| 52 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 56 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
| 53 return make_scoped_ptr(new VideoEncoderVerbatim()); | 57 return make_scoped_ptr(new VideoEncoderVerbatim()); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 audio_task_runner_(audio_task_runner), | 104 audio_task_runner_(audio_task_runner), |
| 101 input_task_runner_(input_task_runner), | 105 input_task_runner_(input_task_runner), |
| 102 video_capture_task_runner_(video_capture_task_runner), | 106 video_capture_task_runner_(video_capture_task_runner), |
| 103 video_encode_task_runner_(video_encode_task_runner), | 107 video_encode_task_runner_(video_encode_task_runner), |
| 104 network_task_runner_(network_task_runner), | 108 network_task_runner_(network_task_runner), |
| 105 ui_task_runner_(ui_task_runner), | 109 ui_task_runner_(ui_task_runner), |
| 106 pairing_registry_(pairing_registry), | 110 pairing_registry_(pairing_registry), |
| 107 is_authenticated_(false), | 111 is_authenticated_(false), |
| 108 pause_video_(false), | 112 pause_video_(false), |
| 109 lossless_video_encode_(false), | 113 lossless_video_encode_(false), |
| 110 lossless_video_color_(false), | 114 lossless_video_color_(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 115 kEnableI444SwitchName)), |
| 111 weak_factory_(this) { | 116 weak_factory_(this) { |
| 112 connection_->SetEventHandler(this); | 117 connection_->SetEventHandler(this); |
| 113 | 118 |
| 114 // Create a manager for the configured extensions, if any. | 119 // Create a manager for the configured extensions, if any. |
| 115 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); | 120 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); |
| 116 | 121 |
| 117 #if defined(OS_WIN) | 122 #if defined(OS_WIN) |
| 118 // LocalInputMonitorWin filters out an echo of the injected input before it | 123 // LocalInputMonitorWin filters out an echo of the injected input before it |
| 119 // reaches |remote_input_filter_|. | 124 // reaches |remote_input_filter_|. |
| 120 remote_input_filter_.SetExpectLocalEcho(false); | 125 remote_input_filter_.SetExpectLocalEcho(false); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 505 |
| 501 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 506 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| 502 DCHECK(CalledOnValidThread()); | 507 DCHECK(CalledOnValidThread()); |
| 503 | 508 |
| 504 return make_scoped_ptr( | 509 return make_scoped_ptr( |
| 505 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), | 510 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), |
| 506 base::ThreadTaskRunnerHandle::Get())); | 511 base::ThreadTaskRunnerHandle::Get())); |
| 507 } | 512 } |
| 508 | 513 |
| 509 } // namespace remoting | 514 } // namespace remoting |
| OLD | NEW |