| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
| 11 #include "remoting/base/encoder.h" | 11 #include "remoting/base/encoder.h" |
| 12 #include "remoting/base/encoder_verbatim.h" | 12 #include "remoting/base/encoder_row_based.h" |
| 13 #include "remoting/base/encoder_vp8.h" | 13 #include "remoting/base/encoder_vp8.h" |
| 14 #include "remoting/base/encoder_zlib.h" | |
| 15 #include "remoting/host/capturer.h" | 14 #include "remoting/host/capturer.h" |
| 16 #include "remoting/host/chromoting_host_context.h" | 15 #include "remoting/host/chromoting_host_context.h" |
| 17 #include "remoting/host/event_executor.h" | 16 #include "remoting/host/event_executor.h" |
| 18 #include "remoting/host/host_config.h" | 17 #include "remoting/host/host_config.h" |
| 19 #include "remoting/host/host_stub_fake.h" | 18 #include "remoting/host/host_stub_fake.h" |
| 20 #include "remoting/host/session_manager.h" | 19 #include "remoting/host/session_manager.h" |
| 21 #include "remoting/protocol/connection_to_client.h" | 20 #include "remoting/protocol/connection_to_client.h" |
| 22 #include "remoting/protocol/host_stub.h" | 21 #include "remoting/protocol/host_stub.h" |
| 23 #include "remoting/protocol/input_stub.h" | 22 #include "remoting/protocol/input_stub.h" |
| 24 #include "remoting/protocol/jingle_session_manager.h" | 23 #include "remoting/protocol/jingle_session_manager.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 307 |
| 309 void ChromotingHost::OnServerClosed() { | 308 void ChromotingHost::OnServerClosed() { |
| 310 // Don't need to do anything here. | 309 // Don't need to do anything here. |
| 311 } | 310 } |
| 312 | 311 |
| 313 // TODO(sergeyu): Move this to SessionManager? | 312 // TODO(sergeyu): Move this to SessionManager? |
| 314 Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig* config) { | 313 Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig* config) { |
| 315 const protocol::ChannelConfig& video_config = config->video_config(); | 314 const protocol::ChannelConfig& video_config = config->video_config(); |
| 316 | 315 |
| 317 if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 316 if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
| 318 return new remoting::EncoderVerbatim(); | 317 return EncoderRowBased::CreateVerbatimEncoder(); |
| 319 } else if (video_config.codec == protocol::ChannelConfig::CODEC_ZIP) { | 318 } else if (video_config.codec == protocol::ChannelConfig::CODEC_ZIP) { |
| 320 return new remoting::EncoderZlib(); | 319 return EncoderRowBased::CreateZlibEncoder(); |
| 321 } | 320 } |
| 322 // TODO(sergeyu): Enable VP8 on ARM builds. | 321 // TODO(sergeyu): Enable VP8 on ARM builds. |
| 323 #if !defined(ARCH_CPU_ARM_FAMILY) | 322 #if !defined(ARCH_CPU_ARM_FAMILY) |
| 324 else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | 323 else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { |
| 325 return new remoting::EncoderVp8(); | 324 return new remoting::EncoderVp8(); |
| 326 } | 325 } |
| 327 #endif | 326 #endif |
| 328 | 327 |
| 329 return NULL; | 328 return NULL; |
| 330 } | 329 } |
| 331 | 330 |
| 332 std::string ChromotingHost::GenerateHostAuthToken( | 331 std::string ChromotingHost::GenerateHostAuthToken( |
| 333 const std::string& encoded_client_token) { | 332 const std::string& encoded_client_token) { |
| 334 // TODO(ajwong): Return the signature of this instead. | 333 // TODO(ajwong): Return the signature of this instead. |
| 335 return encoded_client_token; | 334 return encoded_client_token; |
| 336 } | 335 } |
| 337 | 336 |
| 338 } // namespace remoting | 337 } // namespace remoting |
| OLD | NEW |