OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 555 |
556 int capture_processing_rate = FindNativeProcessRateToUse( | 556 int capture_processing_rate = FindNativeProcessRateToUse( |
557 std::min(formats_.api_format.input_stream().sample_rate_hz(), | 557 std::min(formats_.api_format.input_stream().sample_rate_hz(), |
558 formats_.api_format.output_stream().sample_rate_hz()), | 558 formats_.api_format.output_stream().sample_rate_hz()), |
559 submodule_states_.CaptureMultiBandSubModulesActive() || | 559 submodule_states_.CaptureMultiBandSubModulesActive() || |
560 submodule_states_.RenderMultiBandSubModulesActive()); | 560 submodule_states_.RenderMultiBandSubModulesActive()); |
561 | 561 |
562 capture_nonlocked_.capture_processing_format = | 562 capture_nonlocked_.capture_processing_format = |
563 StreamConfig(capture_processing_rate); | 563 StreamConfig(capture_processing_rate); |
564 | 564 |
565 int render_processing_rate = FindNativeProcessRateToUse( | 565 int render_processing_rate; |
566 std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(), | 566 if (!config_.echo_canceller3.enabled) { |
567 formats_.api_format.reverse_output_stream().sample_rate_hz()), | 567 render_processing_rate = FindNativeProcessRateToUse( |
568 submodule_states_.CaptureMultiBandSubModulesActive() || | 568 std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(), |
569 submodule_states_.RenderMultiBandSubModulesActive()); | 569 formats_.api_format.reverse_output_stream().sample_rate_hz()), |
| 570 submodule_states_.CaptureMultiBandSubModulesActive() || |
| 571 submodule_states_.RenderMultiBandSubModulesActive()); |
| 572 } else { |
| 573 render_processing_rate = capture_processing_rate; |
| 574 } |
| 575 |
570 // TODO(aluebs): Remove this restriction once we figure out why the 3-band | 576 // TODO(aluebs): Remove this restriction once we figure out why the 3-band |
571 // splitting filter degrades the AEC performance. | 577 // splitting filter degrades the AEC performance. |
572 if (render_processing_rate > kSampleRate32kHz && | 578 if (render_processing_rate > kSampleRate32kHz && |
573 !config_.echo_canceller3.enabled) { | 579 !config_.echo_canceller3.enabled) { |
574 render_processing_rate = submodule_states_.RenderMultiBandProcessingActive() | 580 render_processing_rate = submodule_states_.RenderMultiBandProcessingActive() |
575 ? kSampleRate32kHz | 581 ? kSampleRate32kHz |
576 : kSampleRate16kHz; | 582 : kSampleRate16kHz; |
577 } | 583 } |
| 584 |
578 // If the forward sample rate is 8 kHz, the render stream is also processed | 585 // If the forward sample rate is 8 kHz, the render stream is also processed |
579 // at this rate. | 586 // at this rate. |
580 if (capture_nonlocked_.capture_processing_format.sample_rate_hz() == | 587 if (capture_nonlocked_.capture_processing_format.sample_rate_hz() == |
581 kSampleRate8kHz) { | 588 kSampleRate8kHz) { |
582 render_processing_rate = kSampleRate8kHz; | 589 render_processing_rate = kSampleRate8kHz; |
583 } else { | 590 } else { |
584 render_processing_rate = | 591 render_processing_rate = |
585 std::max(render_processing_rate, static_cast<int>(kSampleRate16kHz)); | 592 std::max(render_processing_rate, static_cast<int>(kSampleRate16kHz)); |
586 } | 593 } |
587 | 594 |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 capture_processing_format(kSampleRate16kHz), | 1995 capture_processing_format(kSampleRate16kHz), |
1989 split_rate(kSampleRate16kHz) {} | 1996 split_rate(kSampleRate16kHz) {} |
1990 | 1997 |
1991 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; | 1998 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; |
1992 | 1999 |
1993 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; | 2000 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; |
1994 | 2001 |
1995 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; | 2002 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; |
1996 | 2003 |
1997 } // namespace webrtc | 2004 } // namespace webrtc |
OLD | NEW |