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

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

Issue 23477059: Simplify VideoEncoder interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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
OLDNEW
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/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "remoting/base/capabilities.h" 10 #include "remoting/base/capabilities.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 client_clipboard_factory_.GetWeakPtr(), 419 client_clipboard_factory_.GetWeakPtr(),
420 base::MessageLoopProxy::current())); 420 base::MessageLoopProxy::current()));
421 } 421 }
422 422
423 // TODO(sergeyu): Move this to SessionManager? 423 // TODO(sergeyu): Move this to SessionManager?
424 // static 424 // static
425 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( 425 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder(
426 const protocol::SessionConfig& config) { 426 const protocol::SessionConfig& config) {
427 const protocol::ChannelConfig& video_config = config.video_config(); 427 const protocol::ChannelConfig& video_config = config.video_config();
428 428
429 if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { 429 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
430 return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVerbatim());
431 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
432 return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVp8()); 430 return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVp8());
433 } 431 }
434 432
435 NOTREACHED(); 433 NOTREACHED();
436 return scoped_ptr<VideoEncoder>(); 434 return scoped_ptr<VideoEncoder>();
437 } 435 }
438 436
439 // static 437 // static
440 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( 438 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder(
441 const protocol::SessionConfig& config) { 439 const protocol::SessionConfig& config) {
442 const protocol::ChannelConfig& audio_config = config.audio_config(); 440 const protocol::ChannelConfig& audio_config = config.audio_config();
443 441
444 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { 442 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
445 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); 443 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim());
446 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { 444 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) {
447 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); 445 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus());
448 } 446 }
449 447
450 NOTREACHED(); 448 NOTREACHED();
451 return scoped_ptr<AudioEncoder>(); 449 return scoped_ptr<AudioEncoder>();
452 } 450 }
453 451
454 } // namespace remoting 452 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698