OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
joedow
2016/04/28 22:53:54
no copyright on new files
Hzj_jie
2016/05/03 19:07:05
Done.
| |
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 | |
12 namespace remoting { | |
13 | |
14 std::unique_ptr<VideoEncoder> VideoEncoder::Create( | |
15 const protocol::SessionConfig& config) { | |
16 const protocol::ChannelConfig& video_config = config.video_config(); | |
17 | |
18 if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) { | |
19 return VideoEncoderVpx::CreateForVP8(); | |
20 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) { | |
21 return VideoEncoderVpx::CreateForVP9(); | |
22 } else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | |
23 return base::WrapUnique(new VideoEncoderVerbatim()); | |
24 } | |
25 | |
26 NOTREACHED(); | |
27 return nullptr; | |
28 } | |
29 | |
30 } // namespace remoting | |
OLD | NEW |