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 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 : nullptr; | 125 : nullptr; |
126 }}, | 126 }}, |
127 #endif | 127 #endif |
128 }; | 128 }; |
129 | 129 |
130 class BuiltinAudioDecoderFactory : public AudioDecoderFactory { | 130 class BuiltinAudioDecoderFactory : public AudioDecoderFactory { |
131 public: | 131 public: |
132 std::vector<AudioCodecSpec> GetSupportedDecoders() override { | 132 std::vector<AudioCodecSpec> GetSupportedDecoders() override { |
133 static std::vector<AudioCodecSpec> specs = { | 133 static std::vector<AudioCodecSpec> specs = { |
134 #ifdef WEBRTC_CODEC_OPUS | 134 #ifdef WEBRTC_CODEC_OPUS |
135 { { "opus", 48000, 2, { | 135 {{"opus", |
136 {"minptime", "10" }, | 136 48000, |
137 {"useinbandfec", "1" } | 137 2, |
138 } | 138 { {"minptime", "10"}, |
139 }, false | 139 {"stereo", "0"}, |
140 }, | 140 { "useinbandfec", |
| 141 "1" } }}, |
| 142 false}, |
141 #endif | 143 #endif |
142 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) | 144 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) |
143 { { "isac", 16000, 1 }, true }, | 145 {{"isac", 16000, 1}, true}, |
144 #endif | 146 #endif |
145 #if (defined(WEBRTC_CODEC_ISAC)) | 147 #if (defined(WEBRTC_CODEC_ISAC)) |
146 { { "isac", 32000, 1 }, true }, | 148 {{"isac", 32000, 1}, true}, |
147 #endif | 149 #endif |
148 #ifdef WEBRTC_CODEC_G722 | 150 #ifdef WEBRTC_CODEC_G722 |
149 { { "G722", 8000, 1 }, true }, | 151 {{"G722", 8000, 1}, true}, |
150 #endif | 152 #endif |
151 #ifdef WEBRTC_CODEC_ILBC | 153 #ifdef WEBRTC_CODEC_ILBC |
152 { { "iLBC", 8000, 1 }, true }, | 154 {{"iLBC", 8000, 1}, true}, |
153 #endif | 155 #endif |
154 { { "PCMU", 8000, 1 }, true }, | 156 {{"PCMU", 8000, 1}, true}, |
155 { { "PCMA", 8000, 1 }, true } | 157 {{"PCMA", 8000, 1}, true} |
156 }; | 158 }; |
157 | 159 |
158 return specs; | 160 return specs; |
159 } | 161 } |
160 | 162 |
161 std::unique_ptr<AudioDecoder> MakeAudioDecoder( | 163 std::unique_ptr<AudioDecoder> MakeAudioDecoder( |
162 const SdpAudioFormat& format) override { | 164 const SdpAudioFormat& format) override { |
163 for (const auto& dc : decoder_constructors) { | 165 for (const auto& dc : decoder_constructors) { |
164 if (STR_CASE_CMP(format.name.c_str(), dc.name) == 0) { | 166 if (STR_CASE_CMP(format.name.c_str(), dc.name) == 0) { |
165 std::unique_ptr<AudioDecoder> dec = dc.constructor(format); | 167 std::unique_ptr<AudioDecoder> dec = dc.constructor(format); |
(...skipping 12 matching lines...) Expand all Loading... |
178 }; | 180 }; |
179 | 181 |
180 } // namespace | 182 } // namespace |
181 | 183 |
182 rtc::scoped_refptr<AudioDecoderFactory> CreateBuiltinAudioDecoderFactory() { | 184 rtc::scoped_refptr<AudioDecoderFactory> CreateBuiltinAudioDecoderFactory() { |
183 return rtc::scoped_refptr<AudioDecoderFactory>( | 185 return rtc::scoped_refptr<AudioDecoderFactory>( |
184 new rtc::RefCountedObject<BuiltinAudioDecoderFactory>); | 186 new rtc::RefCountedObject<BuiltinAudioDecoderFactory>); |
185 } | 187 } |
186 | 188 |
187 } // namespace webrtc | 189 } // namespace webrtc |
OLD | NEW |