Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2679103007: Allow residual echo detector to be enabled/disabled using AudioOptions, and no longer disable it on… (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 options.audio_jitter_buffer_max_packets = rtc::Optional<int>(50); 636 options.audio_jitter_buffer_max_packets = rtc::Optional<int>(50);
637 options.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>(false); 637 options.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>(false);
638 options.typing_detection = rtc::Optional<bool>(true); 638 options.typing_detection = rtc::Optional<bool>(true);
639 options.adjust_agc_delta = rtc::Optional<int>(0); 639 options.adjust_agc_delta = rtc::Optional<int>(0);
640 options.experimental_agc = rtc::Optional<bool>(false); 640 options.experimental_agc = rtc::Optional<bool>(false);
641 options.extended_filter_aec = rtc::Optional<bool>(false); 641 options.extended_filter_aec = rtc::Optional<bool>(false);
642 options.delay_agnostic_aec = rtc::Optional<bool>(false); 642 options.delay_agnostic_aec = rtc::Optional<bool>(false);
643 options.experimental_ns = rtc::Optional<bool>(false); 643 options.experimental_ns = rtc::Optional<bool>(false);
644 options.intelligibility_enhancer = rtc::Optional<bool>(false); 644 options.intelligibility_enhancer = rtc::Optional<bool>(false);
645 options.level_control = rtc::Optional<bool>(false); 645 options.level_control = rtc::Optional<bool>(false);
646 // TODO(ivoc): Always enable residual echo detector after benchmarking on
647 // mobile.
648 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
649 options.residual_echo_detector = rtc::Optional<bool>(false);
650 #else
651 options.residual_echo_detector = rtc::Optional<bool>(true); 646 options.residual_echo_detector = rtc::Optional<bool>(true);
652 #endif
653 bool error = ApplyOptions(options); 647 bool error = ApplyOptions(options);
654 RTC_DCHECK(error); 648 RTC_DCHECK(error);
655 } 649 }
656 650
657 SetDefaultDevices(); 651 SetDefaultDevices();
658 } 652 }
659 653
660 WebRtcVoiceEngine::~WebRtcVoiceEngine() { 654 WebRtcVoiceEngine::~WebRtcVoiceEngine() {
661 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 655 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
662 LOG(LS_INFO) << "WebRtcVoiceEngine::~WebRtcVoiceEngine"; 656 LOG(LS_INFO) << "WebRtcVoiceEngine::~WebRtcVoiceEngine";
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 #endif 701 #endif
708 702
709 #if defined(WEBRTC_IOS) || defined(ANDROID) 703 #if defined(WEBRTC_IOS) || defined(ANDROID)
710 // Set the AGC mode for iOS as well despite disabling it above, to avoid 704 // Set the AGC mode for iOS as well despite disabling it above, to avoid
711 // unsupported configuration errors from webrtc. 705 // unsupported configuration errors from webrtc.
712 agc_mode = webrtc::kAgcFixedDigital; 706 agc_mode = webrtc::kAgcFixedDigital;
713 options.typing_detection = rtc::Optional<bool>(false); 707 options.typing_detection = rtc::Optional<bool>(false);
714 options.experimental_agc = rtc::Optional<bool>(false); 708 options.experimental_agc = rtc::Optional<bool>(false);
715 options.extended_filter_aec = rtc::Optional<bool>(false); 709 options.extended_filter_aec = rtc::Optional<bool>(false);
716 options.experimental_ns = rtc::Optional<bool>(false); 710 options.experimental_ns = rtc::Optional<bool>(false);
717 options.residual_echo_detector = rtc::Optional<bool>(false);
718 #endif 711 #endif
719 712
720 // Delay Agnostic AEC automatically turns on EC if not set except on iOS 713 // Delay Agnostic AEC automatically turns on EC if not set except on iOS
721 // where the feature is not supported. 714 // where the feature is not supported.
722 bool use_delay_agnostic_aec = false; 715 bool use_delay_agnostic_aec = false;
723 #if !defined(WEBRTC_IOS) 716 #if !defined(WEBRTC_IOS)
724 if (options.delay_agnostic_aec) { 717 if (options.delay_agnostic_aec) {
725 use_delay_agnostic_aec = *options.delay_agnostic_aec; 718 use_delay_agnostic_aec = *options.delay_agnostic_aec;
726 if (use_delay_agnostic_aec) { 719 if (use_delay_agnostic_aec) {
727 options.echo_cancellation = rtc::Optional<bool>(true); 720 options.echo_cancellation = rtc::Optional<bool>(true);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 if (options.level_control_initial_peak_level_dbfs) { 933 if (options.level_control_initial_peak_level_dbfs) {
941 apm_config_.level_controller.initial_peak_level_dbfs = 934 apm_config_.level_controller.initial_peak_level_dbfs =
942 *options.level_control_initial_peak_level_dbfs; 935 *options.level_control_initial_peak_level_dbfs;
943 } 936 }
944 } 937 }
945 938
946 if (options.highpass_filter) { 939 if (options.highpass_filter) {
947 apm_config_.high_pass_filter.enabled = *options.highpass_filter; 940 apm_config_.high_pass_filter.enabled = *options.highpass_filter;
948 } 941 }
949 942
943 if (options.residual_echo_detector) {
944 apm_config_.residual_echo_detector.enabled =
945 *options.residual_echo_detector;
946 }
947
950 apm()->SetExtraOptions(config); 948 apm()->SetExtraOptions(config);
951 apm()->ApplyConfig(apm_config_); 949 apm()->ApplyConfig(apm_config_);
952 950
953 if (options.recording_sample_rate) { 951 if (options.recording_sample_rate) {
954 LOG(LS_INFO) << "Recording sample rate is " 952 LOG(LS_INFO) << "Recording sample rate is "
955 << *options.recording_sample_rate; 953 << *options.recording_sample_rate;
956 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) { 954 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) {
957 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); 955 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate);
958 } 956 }
959 } 957 }
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
2719 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2717 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2720 const auto it = send_streams_.find(ssrc); 2718 const auto it = send_streams_.find(ssrc);
2721 if (it != send_streams_.end()) { 2719 if (it != send_streams_.end()) {
2722 return it->second->channel(); 2720 return it->second->channel();
2723 } 2721 }
2724 return -1; 2722 return -1;
2725 } 2723 }
2726 } // namespace cricket 2724 } // namespace cricket
2727 2725
2728 #endif // HAVE_WEBRTC_VOICE 2726 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698