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

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

Issue 2415403002: Introduced the new parameter setting scheme for activating the high-pass filter in APM (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years, 1 month 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 | webrtc/modules/BUILD.gn » ('j') | webrtc/modules/BUILD.gn » ('J')
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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 } 777 }
778 if (voep->SetNsStatus(*options.noise_suppression, ns_mode) == -1) { 778 if (voep->SetNsStatus(*options.noise_suppression, ns_mode) == -1) {
779 LOG_RTCERR2(SetNsStatus, *options.noise_suppression, ns_mode); 779 LOG_RTCERR2(SetNsStatus, *options.noise_suppression, ns_mode);
780 return false; 780 return false;
781 } else { 781 } else {
782 LOG(LS_INFO) << "Noise suppression set to " << *options.noise_suppression 782 LOG(LS_INFO) << "Noise suppression set to " << *options.noise_suppression
783 << " with mode " << ns_mode; 783 << " with mode " << ns_mode;
784 } 784 }
785 } 785 }
786 786
787 if (options.highpass_filter) {
788 LOG(LS_INFO) << "High pass filter enabled? " << *options.highpass_filter;
789 if (voep->EnableHighPassFilter(*options.highpass_filter) == -1) {
790 LOG_RTCERR1(SetHighpassFilterStatus, *options.highpass_filter);
791 return false;
792 }
793 }
794
795 if (options.stereo_swapping) { 787 if (options.stereo_swapping) {
796 LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping; 788 LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping;
797 voep->EnableStereoChannelSwapping(*options.stereo_swapping); 789 voep->EnableStereoChannelSwapping(*options.stereo_swapping);
798 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) { 790 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) {
799 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping); 791 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping);
800 return false; 792 return false;
801 } 793 }
802 } 794 }
803 795
804 if (options.audio_jitter_buffer_max_packets) { 796 if (options.audio_jitter_buffer_max_packets) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 LOG(LS_INFO) << "Intelligibility Enhancer is enabled? " 854 LOG(LS_INFO) << "Intelligibility Enhancer is enabled? "
863 << *intelligibility_enhancer_; 855 << *intelligibility_enhancer_;
864 config.Set<webrtc::Intelligibility>( 856 config.Set<webrtc::Intelligibility>(
865 new webrtc::Intelligibility(*intelligibility_enhancer_)); 857 new webrtc::Intelligibility(*intelligibility_enhancer_));
866 } 858 }
867 859
868 if (options.level_control) { 860 if (options.level_control) {
869 level_control_ = options.level_control; 861 level_control_ = options.level_control;
870 } 862 }
871 863
872 LOG(LS_INFO) << "Level control: "
873 << (!!level_control_ ? *level_control_ : -1);
874 webrtc::AudioProcessing::Config apm_config; 864 webrtc::AudioProcessing::Config apm_config;
875 if (level_control_) { 865 if (level_control_) {
876 apm_config.level_controller.enabled = *level_control_; 866 apm_config.level_controller.enabled = *level_control_;
877 if (options.level_control_initial_peak_level_dbfs) { 867 if (options.level_control_initial_peak_level_dbfs) {
878 apm_config.level_controller.initial_peak_level_dbfs = 868 apm_config.level_controller.initial_peak_level_dbfs =
879 *options.level_control_initial_peak_level_dbfs; 869 *options.level_control_initial_peak_level_dbfs;
880 } 870 }
881 } 871 }
882 872
873 if (options.highpass_filter) {
874 apm_config.high_pass_filter.enabled = *options.highpass_filter;
875 }
876
883 apm()->SetExtraOptions(config); 877 apm()->SetExtraOptions(config);
884 apm()->ApplyConfig(apm_config); 878 apm()->ApplyConfig(apm_config);
885 879
886 if (options.recording_sample_rate) { 880 if (options.recording_sample_rate) {
887 LOG(LS_INFO) << "Recording sample rate is " 881 LOG(LS_INFO) << "Recording sample rate is "
888 << *options.recording_sample_rate; 882 << *options.recording_sample_rate;
889 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) { 883 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) {
890 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); 884 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate);
891 } 885 }
892 } 886 }
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2506 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2513 const auto it = send_streams_.find(ssrc); 2507 const auto it = send_streams_.find(ssrc);
2514 if (it != send_streams_.end()) { 2508 if (it != send_streams_.end()) {
2515 return it->second->channel(); 2509 return it->second->channel();
2516 } 2510 }
2517 return -1; 2511 return -1;
2518 } 2512 }
2519 } // namespace cricket 2513 } // namespace cricket
2520 2514
2521 #endif // HAVE_WEBRTC_VOICE 2515 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/BUILD.gn » ('j') | webrtc/modules/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698