OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 case VADVeryAggr: | 272 case VADVeryAggr: |
273 config.vad_mode = Vad::kVadVeryAggressive; | 273 config.vad_mode = Vad::kVadVeryAggressive; |
274 break; | 274 break; |
275 default: | 275 default: |
276 FATAL(); | 276 FATAL(); |
277 } | 277 } |
278 return std::unique_ptr<AudioEncoder>(new AudioEncoderCng(std::move(config))); | 278 return std::unique_ptr<AudioEncoder>(new AudioEncoderCng(std::move(config))); |
279 } | 279 } |
280 | 280 |
281 std::unique_ptr<AudioDecoder> CreateIsacDecoder( | 281 std::unique_ptr<AudioDecoder> CreateIsacDecoder( |
| 282 int sample_rate_hz, |
282 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { | 283 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { |
283 #if defined(WEBRTC_CODEC_ISACFX) | 284 #if defined(WEBRTC_CODEC_ISACFX) |
284 return std::unique_ptr<AudioDecoder>(new AudioDecoderIsacFix(bwinfo)); | 285 return std::unique_ptr<AudioDecoder>( |
| 286 new AudioDecoderIsacFix(sample_rate_hz, bwinfo)); |
285 #elif defined(WEBRTC_CODEC_ISAC) | 287 #elif defined(WEBRTC_CODEC_ISAC) |
286 return std::unique_ptr<AudioDecoder>(new AudioDecoderIsac(bwinfo)); | 288 return std::unique_ptr<AudioDecoder>( |
| 289 new AudioDecoderIsac(sample_rate_hz, bwinfo)); |
287 #else | 290 #else |
288 FATAL() << "iSAC is not supported."; | 291 FATAL() << "iSAC is not supported."; |
289 return std::unique_ptr<AudioDecoder>(); | 292 return std::unique_ptr<AudioDecoder>(); |
290 #endif | 293 #endif |
291 } | 294 } |
292 | 295 |
293 } // namespace | 296 } // namespace |
294 | 297 |
295 RentACodec::RentACodec() { | 298 RentACodec::RentACodec() { |
296 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC) | 299 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 if (param->use_red) { | 353 if (param->use_red) { |
351 encoder_stack = CreateRedEncoder(std::move(encoder_stack), *red_pt); | 354 encoder_stack = CreateRedEncoder(std::move(encoder_stack), *red_pt); |
352 } | 355 } |
353 if (param->use_cng) { | 356 if (param->use_cng) { |
354 encoder_stack = | 357 encoder_stack = |
355 CreateCngEncoder(std::move(encoder_stack), *cng_pt, param->vad_mode); | 358 CreateCngEncoder(std::move(encoder_stack), *cng_pt, param->vad_mode); |
356 } | 359 } |
357 return encoder_stack; | 360 return encoder_stack; |
358 } | 361 } |
359 | 362 |
360 std::unique_ptr<AudioDecoder> RentACodec::RentIsacDecoder() { | 363 std::unique_ptr<AudioDecoder> RentACodec::RentIsacDecoder(int sample_rate_hz) { |
361 return CreateIsacDecoder(isac_bandwidth_info_); | 364 return CreateIsacDecoder(sample_rate_hz, isac_bandwidth_info_); |
362 } | 365 } |
363 | 366 |
364 } // namespace acm2 | 367 } // namespace acm2 |
365 } // namespace webrtc | 368 } // namespace webrtc |
OLD | NEW |