Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: remoting/host/chromoting_host.cc

Issue 5382008: Refactor ZLib and Verbatim encoders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/encoder_zlib.h ('k') | remoting/jingle_glue/jingle_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 316
318 void ChromotingHost::OnServerClosed() { 317 void ChromotingHost::OnServerClosed() {
319 // Don't need to do anything here. 318 // Don't need to do anything here.
320 } 319 }
321 320
322 // TODO(sergeyu): Move this to SessionManager? 321 // TODO(sergeyu): Move this to SessionManager?
323 Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig* config) { 322 Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig* config) {
324 const protocol::ChannelConfig& video_config = config->video_config(); 323 const protocol::ChannelConfig& video_config = config->video_config();
325 324
326 if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { 325 if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
327 return new remoting::EncoderVerbatim(); 326 return EncoderRowBased::CreateVerbatimEncoder();
328 } else if (video_config.codec == protocol::ChannelConfig::CODEC_ZIP) { 327 } else if (video_config.codec == protocol::ChannelConfig::CODEC_ZIP) {
329 return new remoting::EncoderZlib(); 328 return EncoderRowBased::CreateZlibEncoder();
330 } 329 }
331 // TODO(sergeyu): Enable VP8 on ARM builds. 330 // TODO(sergeyu): Enable VP8 on ARM builds.
332 #if !defined(ARCH_CPU_ARM_FAMILY) 331 #if !defined(ARCH_CPU_ARM_FAMILY)
333 else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { 332 else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
334 return new remoting::EncoderVp8(); 333 return new remoting::EncoderVp8();
335 } 334 }
336 #endif 335 #endif
337 336
338 return NULL; 337 return NULL;
339 } 338 }
340 339
341 std::string ChromotingHost::GenerateHostAuthToken( 340 std::string ChromotingHost::GenerateHostAuthToken(
342 const std::string& encoded_client_token) { 341 const std::string& encoded_client_token) {
343 // TODO(ajwong): Return the signature of this instead. 342 // TODO(ajwong): Return the signature of this instead.
344 return encoded_client_token; 343 return encoded_client_token;
345 } 344 }
346 345
347 } // namespace remoting 346 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/encoder_zlib.h ('k') | remoting/jingle_glue/jingle_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698