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

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

Issue 2292863002: Introduced new scheme for controlling the functionality inside the audio processing module (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years, 3 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
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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 config.Set<webrtc::Intelligibility>( 865 config.Set<webrtc::Intelligibility>(
866 new webrtc::Intelligibility(*intelligibility_enhancer_)); 866 new webrtc::Intelligibility(*intelligibility_enhancer_));
867 } 867 }
868 868
869 if (options.level_control) { 869 if (options.level_control) {
870 level_control_ = options.level_control; 870 level_control_ = options.level_control;
871 } 871 }
872 872
873 LOG(LS_INFO) << "Level control: " 873 LOG(LS_INFO) << "Level control: "
874 << (!!level_control_ ? *level_control_ : -1); 874 << (!!level_control_ ? *level_control_ : -1);
875 webrtc::AudioProcessing::Config apm_config;
875 if (level_control_) { 876 if (level_control_) {
876 config.Set<webrtc::LevelControl>(new webrtc::LevelControl(*level_control_)); 877 apm_config.level_controller.enabled = *level_control_;
877 } 878 }
878 879
879 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine 880 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine
880 // returns NULL on audio_processing(). 881 // returns NULL on audio_processing().
881 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing(); 882 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing();
882 if (audioproc) { 883 if (audioproc) {
883 audioproc->SetExtraOptions(config); 884 audioproc->SetExtraOptions(config);
885 RTC_DCHECK(apm_config.Validate());
886 RTC_DCHECK(audioproc->ApplyConfig(apm_config));
hlundin-webrtc 2016/09/06 08:56:03 Using a DCHECK here means that ApplyConfig is only
peah-webrtc 2016/09/07 05:42:59 Ah, thanks! Done.
884 } 887 }
885 888
886 if (options.recording_sample_rate) { 889 if (options.recording_sample_rate) {
887 LOG(LS_INFO) << "Recording sample rate is " 890 LOG(LS_INFO) << "Recording sample rate is "
888 << *options.recording_sample_rate; 891 << *options.recording_sample_rate;
889 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) { 892 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) {
890 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); 893 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate);
891 } 894 }
892 } 895 }
893 896
(...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2666 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2664 const auto it = send_streams_.find(ssrc); 2667 const auto it = send_streams_.find(ssrc);
2665 if (it != send_streams_.end()) { 2668 if (it != send_streams_.end()) {
2666 return it->second->channel(); 2669 return it->second->channel();
2667 } 2670 }
2668 return -1; 2671 return -1;
2669 } 2672 }
2670 } // namespace cricket 2673 } // namespace cricket
2671 2674
2672 #endif // HAVE_WEBRTC_VOICE 2675 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698