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

Unified Diff: webrtc/voice_engine/voe_base_impl.cc

Issue 2969213002: External APM usage downstream dependency support cleanup (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/voe_base_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/voe_base_impl.cc
diff --git a/webrtc/voice_engine/voe_base_impl.cc b/webrtc/voice_engine/voe_base_impl.cc
index 196c6a555febcf4efb93f367d1a3c7e36a11c340..6d69cafd86dc65c6d2cfba695474000cf7dce9a7 100644
--- a/webrtc/voice_engine/voe_base_impl.cc
+++ b/webrtc/voice_engine/voe_base_impl.cc
@@ -227,8 +227,7 @@ int VoEBaseImpl::Init(
AudioDeviceModule* external_adm,
AudioProcessing* external_apm,
ossu 2017/07/05 16:16:46 Is it really necessary to call this one the extern
peah-webrtc 2017/07/06 07:47:32 Good point! I changed that to the name audio_proce
const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) {
- // TODO(peah): Add a DCHECK for external_apm when downstream dependencies
- // have properly been resolved.
+ RTC_DCHECK(external_apm);
rtc::CritScope cs(shared_->crit_sec());
WebRtcSpl_Init();
if (shared_->statistics().Initialized()) {
@@ -339,43 +338,27 @@ int VoEBaseImpl::Init(
"Init() failed to set mono/stereo recording mode");
}
- // TODO(peah): Remove this when upstream dependencies have properly been
- // resolved.
- AudioProcessing* apm = nullptr;
- if (!external_apm) {
- audio_processing_ = AudioProcessing::Create();
- if (!audio_processing_) {
- // This can only happen if there are problems allocating the dynamic
- // memory in the Create() call.
- LOG(LS_ERROR) << "Failed to create AudioProcessing.";
- shared_->SetLastError(VE_NO_MEMORY);
- return -1;
- }
- apm = audio_processing_.get();
- } else {
- apm = external_apm;
- }
-
- shared_->set_audio_processing(apm);
+ shared_->set_audio_processing(external_apm);
// Set the error state for any failures in this block.
shared_->SetLastError(VE_APM_ERROR);
// Configure AudioProcessing components.
// TODO(peah): Move this initialization to webrtcvoiceengine.cc.
- if (apm->high_pass_filter()->Enable(true) != 0) {
+ if (external_apm->high_pass_filter()->Enable(true) != 0) {
LOG_F(LS_ERROR) << "Failed to enable high pass filter.";
return -1;
}
- if (apm->echo_cancellation()->enable_drift_compensation(false) != 0) {
+ if (external_apm->echo_cancellation()->enable_drift_compensation(false) !=
+ 0) {
LOG_F(LS_ERROR) << "Failed to disable drift compensation.";
return -1;
}
- if (apm->noise_suppression()->set_level(kDefaultNsMode) != 0) {
+ if (external_apm->noise_suppression()->set_level(kDefaultNsMode) != 0) {
LOG_F(LS_ERROR) << "Failed to set noise suppression level: "
<< kDefaultNsMode;
return -1;
}
- GainControl* agc = apm->gain_control();
+ GainControl* agc = external_apm->gain_control();
if (agc->set_analog_level_limits(kMinVolumeLevel, kMaxVolumeLevel) != 0) {
LOG_F(LS_ERROR) << "Failed to set analog level limits with minimum: "
<< kMinVolumeLevel << " and maximum: " << kMaxVolumeLevel;
« no previous file with comments | « webrtc/voice_engine/voe_base_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698