OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/modules/video_coding/codecs/vp8/vp8_factory.h" | |
12 | |
13 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h" | |
14 #include "webrtc/modules/video_coding/codecs/vp8/vp8_impl.h" | |
15 | |
16 namespace webrtc { | |
17 | |
18 bool VP8EncoderFactoryConfig::use_simulcast_adapter_ = false; | |
19 | |
20 class VP8EncoderImplFactory : public VideoEncoderFactory { | |
21 public: | |
22 VideoEncoder* Create() override { return new VP8EncoderImpl(); } | |
23 | |
24 void Destroy(VideoEncoder* encoder) override { delete encoder; } | |
25 | |
26 virtual ~VP8EncoderImplFactory() {} | |
27 }; | |
28 | |
29 VP8Encoder* VP8Encoder::Create() { | |
30 if (VP8EncoderFactoryConfig::use_simulcast_adapter()) { | |
31 return new SimulcastEncoderAdapter(new VP8EncoderImplFactory()); | |
32 } else { | |
33 return new VP8EncoderImpl(); | |
34 } | |
35 } | |
36 | |
37 VP8Decoder* VP8Decoder::Create() { | |
38 return new VP8DecoderImpl(); | |
39 } | |
40 | |
41 } // namespace webrtc | |
OLD | NEW |