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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return rtc::Optional<int>(2); | 155 return rtc::Optional<int>(2); |
156 } else { | 156 } else { |
157 return rtc::Optional<int>(); // Bad stereo parameter. | 157 return rtc::Optional<int>(); // Bad stereo parameter. |
158 } | 158 } |
159 } | 159 } |
160 return rtc::Optional<int>(1); // Default to mono. | 160 return rtc::Optional<int>(1); // Default to mono. |
161 }(); | 161 }(); |
162 if (format.clockrate_hz == 48000 && format.num_channels == 2 && | 162 if (format.clockrate_hz == 48000 && format.num_channels == 2 && |
163 num_channels) { | 163 num_channels) { |
164 if (out) { | 164 if (out) { |
165 out->reset(new AudioDecoderOpusImpl(*num_channels)); | 165 out->reset(new AudioDecoderOpus(*num_channels)); |
166 } | 166 } |
167 return true; | 167 return true; |
168 } else { | 168 } else { |
169 return false; | 169 return false; |
170 } | 170 } |
171 }}, | 171 }}, |
172 #endif | 172 #endif |
173 }; | 173 }; |
174 | 174 |
175 class BuiltinAudioDecoderFactory : public AudioDecoderFactory { | 175 class BuiltinAudioDecoderFactory : public AudioDecoderFactory { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 } // namespace | 249 } // namespace |
250 | 250 |
251 rtc::scoped_refptr<AudioDecoderFactory> | 251 rtc::scoped_refptr<AudioDecoderFactory> |
252 CreateBuiltinAudioDecoderFactoryInternal() { | 252 CreateBuiltinAudioDecoderFactoryInternal() { |
253 return rtc::scoped_refptr<AudioDecoderFactory>( | 253 return rtc::scoped_refptr<AudioDecoderFactory>( |
254 new rtc::RefCountedObject<BuiltinAudioDecoderFactory>); | 254 new rtc::RefCountedObject<BuiltinAudioDecoderFactory>); |
255 } | 255 } |
256 | 256 |
257 } // namespace webrtc | 257 } // namespace webrtc |
OLD | NEW |