Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "remoting/codec/video_encoder.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/memory/ptr_util.h" | |
| 9 #include "remoting/codec/video_encoder_verbatim.h" | |
| 10 #include "remoting/codec/video_encoder_vpx.h" | |
| 11 #include "remoting/protocol/session_config.h" | |
| 12 | |
| 13 namespace remoting { | |
| 14 | |
| 15 std::unique_ptr<VideoEncoder> VideoEncoder::Create( | |
| 16 const protocol::SessionConfig& config) { | |
| 17 const protocol::ChannelConfig& video_config = config.video_config(); | |
| 18 | |
| 19 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | |
| 20 return VideoEncoderVpx::CreateForVP8(); | |
| 21 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { | |
| 22 return VideoEncoderVpx::CreateForVP9(); | |
| 23 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | |
| 24 return base::WrapUnique(new VideoEncoderVerbatim()); | |
| 25 } | |
| 26 | |
| 27 NOTREACHED(); | |
|
joedow
2016/05/03 22:28:29
Should this include a log to state which values wa
Hzj_jie
2016/05/04 02:11:56
I copied and pasted this logic from ice_connection
| |
| 28 return nullptr; | |
| 29 } | |
| 30 | |
| 31 } // namespace remoting | |
| OLD | NEW |