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

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: New approach for introducing the new parameter setting scheme 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
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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 774 }
775 if (voep->SetNsStatus(*options.noise_suppression, ns_mode) == -1) { 775 if (voep->SetNsStatus(*options.noise_suppression, ns_mode) == -1) {
776 LOG_RTCERR2(SetNsStatus, *options.noise_suppression, ns_mode); 776 LOG_RTCERR2(SetNsStatus, *options.noise_suppression, ns_mode);
777 return false; 777 return false;
778 } else { 778 } else {
779 LOG(LS_INFO) << "Noise suppression set to " << *options.noise_suppression 779 LOG(LS_INFO) << "Noise suppression set to " << *options.noise_suppression
780 << " with mode " << ns_mode; 780 << " with mode " << ns_mode;
781 } 781 }
782 } 782 }
783 783
784 if (options.highpass_filter) {
785 LOG(LS_INFO) << "High pass filter enabled? " << *options.highpass_filter;
786 if (voep->EnableHighPassFilter(*options.highpass_filter) == -1) {
787 LOG_RTCERR1(SetHighpassFilterStatus, *options.highpass_filter);
788 return false;
789 }
790 }
791
792 if (options.stereo_swapping) { 784 if (options.stereo_swapping) {
793 LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping; 785 LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping;
794 voep->EnableStereoChannelSwapping(*options.stereo_swapping); 786 voep->EnableStereoChannelSwapping(*options.stereo_swapping);
795 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) { 787 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) {
796 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping); 788 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping);
797 return false; 789 return false;
798 } 790 }
799 } 791 }
800 792
801 if (options.audio_jitter_buffer_max_packets) { 793 if (options.audio_jitter_buffer_max_packets) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 << (!!level_control_ ? *level_control_ : -1); 862 << (!!level_control_ ? *level_control_ : -1);
871 webrtc::AudioProcessing::Config apm_config; 863 webrtc::AudioProcessing::Config apm_config;
872 if (level_control_) { 864 if (level_control_) {
873 apm_config.level_controller.enabled = *level_control_; 865 apm_config.level_controller.enabled = *level_control_;
874 if (options.level_control_initial_peak_level_dbfs) { 866 if (options.level_control_initial_peak_level_dbfs) {
875 apm_config.level_controller.initial_peak_level_dbfs = 867 apm_config.level_controller.initial_peak_level_dbfs =
876 *options.level_control_initial_peak_level_dbfs; 868 *options.level_control_initial_peak_level_dbfs;
877 } 869 }
878 } 870 }
879 871
872 LOG(LS_INFO) << "High pass filter: "
the sun 2016/10/26 09:06:43 If the AudioProcessing::Config has a ToString() me
peah-webrtc 2016/10/28 05:50:28 I totally agree! I remove this log line as well as
873 << (!!options.highpass_filter ? *options.highpass_filter : -1);
874 if (options.highpass_filter) {
875 apm_config.high_pass_filter.enabled = *options.highpass_filter;
876 }
877
880 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine 878 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine
881 // returns NULL on audio_processing(). 879 // returns NULL on audio_processing().
882 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing(); 880 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing();
883 if (audioproc) { 881 if (audioproc) {
884 audioproc->SetExtraOptions(config); 882 audioproc->SetExtraOptions(config);
885 audioproc->ApplyConfig(apm_config); 883 audioproc->ApplyConfig(apm_config);
886 } 884 }
887 885
888 if (options.recording_sample_rate) { 886 if (options.recording_sample_rate) {
889 LOG(LS_INFO) << "Recording sample rate is " 887 LOG(LS_INFO) << "Recording sample rate is "
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
2515 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2513 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2516 const auto it = send_streams_.find(ssrc); 2514 const auto it = send_streams_.find(ssrc);
2517 if (it != send_streams_.end()) { 2515 if (it != send_streams_.end()) {
2518 return it->second->channel(); 2516 return it->second->channel();
2519 } 2517 }
2520 return -1; 2518 return -1;
2521 } 2519 }
2522 } // namespace cricket 2520 } // namespace cricket
2523 2521
2524 #endif // HAVE_WEBRTC_VOICE 2522 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/BUILD.gn » ('j') | webrtc/modules/audio_processing/audio_processing_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698