| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 // TODO(sergeyu): Move this to SessionManager? | 482 // TODO(sergeyu): Move this to SessionManager? |
| 483 // static | 483 // static |
| 484 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( | 484 scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder( |
| 485 const protocol::SessionConfig& config) { | 485 const protocol::SessionConfig& config) { |
| 486 const protocol::ChannelConfig& video_config = config.video_config(); | 486 const protocol::ChannelConfig& video_config = config.video_config(); |
| 487 | 487 |
| 488 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | 488 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { |
| 489 return remoting::VideoEncoderVpx::CreateForVP8().PassAs<VideoEncoder>(); | 489 return remoting::VideoEncoderVpx::CreateForVP8().PassAs<VideoEncoder>(); |
| 490 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { | 490 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { |
| 491 return remoting::VideoEncoderVpx::CreateForVP9().PassAs<VideoEncoder>(); | 491 return remoting::VideoEncoderVpx::CreateForVP9().PassAs<VideoEncoder>(); |
| 492 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
| 493 return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVerbatim()); |
| 492 } | 494 } |
| 493 | 495 |
| 494 NOTREACHED(); | 496 NOTREACHED(); |
| 495 return scoped_ptr<VideoEncoder>(); | 497 return scoped_ptr<VideoEncoder>(); |
| 496 } | 498 } |
| 497 | 499 |
| 498 // static | 500 // static |
| 499 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( | 501 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( |
| 500 const protocol::SessionConfig& config) { | 502 const protocol::SessionConfig& config) { |
| 501 const protocol::ChannelConfig& audio_config = config.audio_config(); | 503 const protocol::ChannelConfig& audio_config = config.audio_config(); |
| 502 | 504 |
| 503 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 505 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
| 504 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 506 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
| 505 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 507 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
| 506 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 508 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
| 507 } | 509 } |
| 508 | 510 |
| 509 NOTREACHED(); | 511 NOTREACHED(); |
| 510 return scoped_ptr<AudioEncoder>(); | 512 return scoped_ptr<AudioEncoder>(); |
| 511 } | 513 } |
| 512 | 514 |
| 513 } // namespace remoting | 515 } // namespace remoting |
| OLD | NEW |