| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 return new WebRtcVoiceMediaChannel(this, config, options, call); | 674 return new WebRtcVoiceMediaChannel(this, config, options, call); |
| 675 } | 675 } |
| 676 | 676 |
| 677 bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { | 677 bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { |
| 678 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 678 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 679 LOG(LS_INFO) << "WebRtcVoiceEngine::ApplyOptions: " << options_in.ToString(); | 679 LOG(LS_INFO) << "WebRtcVoiceEngine::ApplyOptions: " << options_in.ToString(); |
| 680 AudioOptions options = options_in; // The options are modified below. | 680 AudioOptions options = options_in; // The options are modified below. |
| 681 | 681 |
| 682 // kEcConference is AEC with high suppression. | 682 // kEcConference is AEC with high suppression. |
| 683 webrtc::EcModes ec_mode = webrtc::kEcConference; | 683 webrtc::EcModes ec_mode = webrtc::kEcConference; |
| 684 webrtc::AgcModes agc_mode = webrtc::kAgcAdaptiveAnalog; | |
| 685 if (options.aecm_generate_comfort_noise) { | 684 if (options.aecm_generate_comfort_noise) { |
| 686 LOG(LS_VERBOSE) << "Comfort noise explicitly set to " | 685 LOG(LS_VERBOSE) << "Comfort noise explicitly set to " |
| 687 << *options.aecm_generate_comfort_noise | 686 << *options.aecm_generate_comfort_noise |
| 688 << " (default is false)."; | 687 << " (default is false)."; |
| 689 } | 688 } |
| 690 | 689 |
| 691 #if defined(WEBRTC_IOS) | 690 #if defined(WEBRTC_IOS) |
| 692 // On iOS, VPIO provides built-in EC, NS and AGC. | 691 // On iOS, VPIO provides built-in EC, NS and AGC. |
| 693 options.echo_cancellation = rtc::Optional<bool>(false); | 692 options.echo_cancellation = rtc::Optional<bool>(false); |
| 694 options.auto_gain_control = rtc::Optional<bool>(false); | 693 options.auto_gain_control = rtc::Optional<bool>(false); |
| 695 options.noise_suppression = rtc::Optional<bool>(false); | 694 options.noise_suppression = rtc::Optional<bool>(false); |
| 696 LOG(LS_INFO) | 695 LOG(LS_INFO) |
| 697 << "Always disable AEC, NS and AGC on iOS. Use built-in instead."; | 696 << "Always disable AEC, NS and AGC on iOS. Use built-in instead."; |
| 698 #elif defined(ANDROID) | 697 #elif defined(ANDROID) |
| 699 ec_mode = webrtc::kEcAecm; | 698 ec_mode = webrtc::kEcAecm; |
| 700 #endif | 699 #endif |
| 701 | 700 |
| 702 #if defined(WEBRTC_IOS) || defined(ANDROID) | 701 #if defined(WEBRTC_IOS) || defined(ANDROID) |
| 703 // Set the AGC mode for iOS as well despite disabling it above, to avoid | |
| 704 // unsupported configuration errors from webrtc. | |
| 705 agc_mode = webrtc::kAgcFixedDigital; | |
| 706 options.typing_detection = rtc::Optional<bool>(false); | 702 options.typing_detection = rtc::Optional<bool>(false); |
| 707 options.experimental_agc = rtc::Optional<bool>(false); | 703 options.experimental_agc = rtc::Optional<bool>(false); |
| 708 options.extended_filter_aec = rtc::Optional<bool>(false); | 704 options.extended_filter_aec = rtc::Optional<bool>(false); |
| 709 options.experimental_ns = rtc::Optional<bool>(false); | 705 options.experimental_ns = rtc::Optional<bool>(false); |
| 710 #endif | 706 #endif |
| 711 | 707 |
| 712 // Delay Agnostic AEC automatically turns on EC if not set except on iOS | 708 // Delay Agnostic AEC automatically turns on EC if not set except on iOS |
| 713 // where the feature is not supported. | 709 // where the feature is not supported. |
| 714 bool use_delay_agnostic_aec = false; | 710 bool use_delay_agnostic_aec = false; |
| 715 #if !defined(WEBRTC_IOS) | 711 #if !defined(WEBRTC_IOS) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 bool built_in_agc_avaliable = adm()->BuiltInAGCIsAvailable(); | 759 bool built_in_agc_avaliable = adm()->BuiltInAGCIsAvailable(); |
| 764 if (built_in_agc_avaliable) { | 760 if (built_in_agc_avaliable) { |
| 765 if (adm()->EnableBuiltInAGC(*options.auto_gain_control) == 0 && | 761 if (adm()->EnableBuiltInAGC(*options.auto_gain_control) == 0 && |
| 766 *options.auto_gain_control) { | 762 *options.auto_gain_control) { |
| 767 // Disable internal software AGC if built-in AGC is enabled, | 763 // Disable internal software AGC if built-in AGC is enabled, |
| 768 // i.e., replace the software AGC with the built-in AGC. | 764 // i.e., replace the software AGC with the built-in AGC. |
| 769 options.auto_gain_control = rtc::Optional<bool>(false); | 765 options.auto_gain_control = rtc::Optional<bool>(false); |
| 770 LOG(LS_INFO) << "Disabling AGC since built-in AGC will be used instead"; | 766 LOG(LS_INFO) << "Disabling AGC since built-in AGC will be used instead"; |
| 771 } | 767 } |
| 772 } | 768 } |
| 773 webrtc::apm_helpers::SetAgcStatus( | 769 webrtc::apm_helpers::SetAgcStatus(apm(), adm(), *options.auto_gain_control); |
| 774 apm(), adm(), *options.auto_gain_control, agc_mode); | |
| 775 } | 770 } |
| 776 | 771 |
| 777 if (options.tx_agc_target_dbov || options.tx_agc_digital_compression_gain || | 772 if (options.tx_agc_target_dbov || options.tx_agc_digital_compression_gain || |
| 778 options.tx_agc_limiter || options.adjust_agc_delta) { | 773 options.tx_agc_limiter || options.adjust_agc_delta) { |
| 779 // Override default_agc_config_. Generally, an unset option means "leave | 774 // Override default_agc_config_. Generally, an unset option means "leave |
| 780 // the VoE bits alone" in this function, so we want whatever is set to be | 775 // the VoE bits alone" in this function, so we want whatever is set to be |
| 781 // stored as the new "default". If we didn't, then setting e.g. | 776 // stored as the new "default". If we didn't, then setting e.g. |
| 782 // tx_agc_target_dbov would reset digital compression gain and limiter | 777 // tx_agc_target_dbov would reset digital compression gain and limiter |
| 783 // settings. | 778 // settings. |
| 784 // Also, if we don't update default_agc_config_, then adjust_agc_delta | 779 // Also, if we don't update default_agc_config_, then adjust_agc_delta |
| (...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 ssrc); | 2654 ssrc); |
| 2660 if (it != unsignaled_recv_ssrcs_.end()) { | 2655 if (it != unsignaled_recv_ssrcs_.end()) { |
| 2661 unsignaled_recv_ssrcs_.erase(it); | 2656 unsignaled_recv_ssrcs_.erase(it); |
| 2662 return true; | 2657 return true; |
| 2663 } | 2658 } |
| 2664 return false; | 2659 return false; |
| 2665 } | 2660 } |
| 2666 } // namespace cricket | 2661 } // namespace cricket |
| 2667 | 2662 |
| 2668 #endif // HAVE_WEBRTC_VOICE | 2663 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |