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/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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 437 } |
438 | 438 |
439 // TODO(sergeyu): Move this to SessionManager? | 439 // TODO(sergeyu): Move this to SessionManager? |
440 // static | 440 // static |
441 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( | 441 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( |
442 const protocol::SessionConfig& config) { | 442 const protocol::SessionConfig& config) { |
443 const protocol::ChannelConfig& video_config = config.video_config(); | 443 const protocol::ChannelConfig& video_config = config.video_config(); |
444 | 444 |
445 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | 445 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { |
446 return remoting::VideoEncoderVpx::CreateForVP8().PassAs<VideoEncoder>(); | 446 return remoting::VideoEncoderVpx::CreateForVP8().PassAs<VideoEncoder>(); |
447 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { | |
448 return remoting::VideoEncoderVpx::CreateForVP9().PassAs<VideoEncoder>(); | |
449 } | 447 } |
450 | 448 |
451 NOTREACHED(); | 449 NOTREACHED(); |
452 return scoped_ptr<VideoEncoder>(); | 450 return scoped_ptr<VideoEncoder>(); |
453 } | 451 } |
454 | 452 |
455 // static | 453 // static |
456 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( | 454 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( |
457 const protocol::SessionConfig& config) { | 455 const protocol::SessionConfig& config) { |
458 const protocol::ChannelConfig& audio_config = config.audio_config(); | 456 const protocol::ChannelConfig& audio_config = config.audio_config(); |
459 | 457 |
460 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 458 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
461 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 459 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
462 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 460 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
463 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 461 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
464 } | 462 } |
465 | 463 |
466 NOTREACHED(); | 464 NOTREACHED(); |
467 return scoped_ptr<AudioEncoder>(); | 465 return scoped_ptr<AudioEncoder>(); |
468 } | 466 } |
469 | 467 |
470 } // namespace remoting | 468 } // namespace remoting |
OLD | NEW |