Chromium Code Reviews| 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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 |
| 883 apm()->SetExtraOptions(config); | 873 if (options.highpass_filter) { |
| 884 apm()->ApplyConfig(apm_config); | 874 apm_config.high_pass_filter.enabled = *options.highpass_filter; |
| 875 } | |
| 876 | |
| 877 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine | |
| 878 // returns NULL on audio_processing(). | |
| 879 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing(); | |
| 880 if (audioproc) { | |
|
the sun
2016/10/28 10:52:53
Revert back to "apm()->" for these two calls. Remo
peah-webrtc
2016/10/28 12:19:52
Sorry, this was caused by my manually reverting th
| |
| 881 audioproc->SetExtraOptions(config); | |
| 882 audioproc->ApplyConfig(apm_config); | |
| 883 } | |
| 885 | 884 |
| 886 if (options.recording_sample_rate) { | 885 if (options.recording_sample_rate) { |
| 887 LOG(LS_INFO) << "Recording sample rate is " | 886 LOG(LS_INFO) << "Recording sample rate is " |
| 888 << *options.recording_sample_rate; | 887 << *options.recording_sample_rate; |
| 889 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) { | 888 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) { |
| 890 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); | 889 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); |
| 891 } | 890 } |
| 892 } | 891 } |
| 893 | 892 |
| 894 if (options.playout_sample_rate) { | 893 if (options.playout_sample_rate) { |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2512 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2511 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2513 const auto it = send_streams_.find(ssrc); | 2512 const auto it = send_streams_.find(ssrc); |
| 2514 if (it != send_streams_.end()) { | 2513 if (it != send_streams_.end()) { |
| 2515 return it->second->channel(); | 2514 return it->second->channel(); |
| 2516 } | 2515 } |
| 2517 return -1; | 2516 return -1; |
| 2518 } | 2517 } |
| 2519 } // namespace cricket | 2518 } // namespace cricket |
| 2520 | 2519 |
| 2521 #endif // HAVE_WEBRTC_VOICE | 2520 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |