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() << "Unknown code type: " << video_config.codec; |
| 28 return nullptr; |
| 29 } |
| 30 |
| 31 } // namespace remoting |
OLD | NEW |