OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" | 11 #include "webrtc/modules/audio_coding/codecs/internal_builtin_audio_decoder_fact ory.h" |
12 | 12 |
13 #include <memory> | |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
15 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
16 #include "webrtc/base/optional.h" | 17 #include "webrtc/base/optional.h" |
17 #include "webrtc/common_types.h" | 18 #include "webrtc/common_types.h" |
18 #include "webrtc/modules/audio_coding/codecs/cng/webrtc_cng.h" | 19 #include "webrtc/modules/audio_coding/codecs/cng/webrtc_cng.h" |
19 #include "webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h" | 20 #include "webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h" |
20 #ifdef WEBRTC_CODEC_G722 | 21 #ifdef WEBRTC_CODEC_G722 |
21 #include "webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.h" | 22 #include "webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.h" |
22 #endif | 23 #endif |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 } | 170 } |
170 }}, | 171 }}, |
171 #endif | 172 #endif |
172 }; | 173 }; |
173 | 174 |
174 class BuiltinAudioDecoderFactory : public AudioDecoderFactory { | 175 class BuiltinAudioDecoderFactory : public AudioDecoderFactory { |
175 public: | 176 public: |
176 std::vector<AudioCodecSpec> GetSupportedDecoders() override { | 177 std::vector<AudioCodecSpec> GetSupportedDecoders() override { |
177 static std::vector<AudioCodecSpec> specs = { | 178 static std::vector<AudioCodecSpec> specs = { |
178 #ifdef WEBRTC_CODEC_OPUS | 179 #ifdef WEBRTC_CODEC_OPUS |
179 { { "opus", 48000, 2, { | 180 {{"opus", |
180 {"minptime", "10" }, | 181 48000, |
181 {"useinbandfec", "1" } | 182 2, |
182 } | 183 { {"minptime", "10"}, |
183 }, false | 184 { "useinbandfec", |
ossu
2017/02/01 15:05:26
This was highlighted in my CL that clang-formatted
kwiberg-webrtc
2017/02/01 20:15:03
I don't disagree. But again, this line only got ch
ossu
2017/02/06 12:54:16
I do feel quite strongly about this case. clang-fo
kwiberg-webrtc
2017/02/06 14:19:36
OK, I'll make sure this is lovingly hand-formatted
ossu
2017/02/06 14:44:06
Artisanal lines of code - I like it!
| |
184 }, | 185 "1" } }}, |
186 false}, | |
185 #endif | 187 #endif |
186 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) | 188 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) |
187 {{"isac", 16000, 1}, true}, | 189 {{"isac", 16000, 1}, true}, |
188 #endif | 190 #endif |
189 #if (defined(WEBRTC_CODEC_ISAC)) | 191 #if (defined(WEBRTC_CODEC_ISAC)) |
190 {{"isac", 32000, 1}, true}, | 192 {{"isac", 32000, 1}, true}, |
191 #endif | 193 #endif |
192 #ifdef WEBRTC_CODEC_G722 | 194 #ifdef WEBRTC_CODEC_G722 |
193 {{"G722", 8000, 1}, true}, | 195 {{"G722", 8000, 1}, true}, |
194 #endif | 196 #endif |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 } | 229 } |
228 return decoder; | 230 return decoder; |
229 } | 231 } |
230 } | 232 } |
231 return nullptr; | 233 return nullptr; |
232 } | 234 } |
233 }; | 235 }; |
234 | 236 |
235 } // namespace | 237 } // namespace |
236 | 238 |
237 rtc::scoped_refptr<AudioDecoderFactory> CreateBuiltinAudioDecoderFactory() { | 239 rtc::scoped_refptr<AudioDecoderFactory> |
240 InternalCreateBuiltinAudioDecoderFactory() { | |
238 return rtc::scoped_refptr<AudioDecoderFactory>( | 241 return rtc::scoped_refptr<AudioDecoderFactory>( |
239 new rtc::RefCountedObject<BuiltinAudioDecoderFactory>); | 242 new rtc::RefCountedObject<BuiltinAudioDecoderFactory>); |
240 } | 243 } |
241 | 244 |
242 } // namespace webrtc | 245 } // namespace webrtc |
OLD | NEW |