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

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1952123003: Surface the IntelligibilityEnhancer on MediaConstraints (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change to use MediaConstraints Created 4 years, 7 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
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index d89cc339315c5bf6b76cda4334eff5dbe8137121..c9fec0f577be91999449c9f8213e83ce8d4dc025 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -163,12 +163,10 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config,
private_submodules_(new ApmPrivateSubmodules(beamformer)),
constants_(config.Get<ExperimentalAgc>().startup_min_volume,
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
- false,
+ false),
#else
- config.Get<ExperimentalAgc>().enabled,
+ config.Get<ExperimentalAgc>().enabled),
#endif
- config.Get<Intelligibility>().enabled),
-
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
capture_(false,
#else
@@ -176,7 +174,8 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config,
#endif
config.Get<Beamforming>().array_geometry,
config.Get<Beamforming>().target_direction),
- capture_nonlocked_(config.Get<Beamforming>().enabled)
+ capture_nonlocked_(config.Get<Beamforming>().enabled,
+ config.Get<Intelligibility>().enabled)
{
{
rtc::CritScope cs_render(&crit_render_);
@@ -411,6 +410,13 @@ void AudioProcessingImpl::SetExtraOptions(const Config& config) {
InitializeTransient();
}
+ if(capture_nonlocked_.intelligibility_enabled !=
+ config.Get<Intelligibility>().enabled) {
+ capture_nonlocked_.intelligibility_enabled =
+ config.Get<Intelligibility>().enabled;
+ InitializeIntelligibility();
tommi 2016/05/11 06:06:48 Don't you need to check first if the value is true
aluebs-webrtc 2016/05/11 21:22:05 The check if the value is true is done inside Init
tommi 2016/05/12 07:06:38 OK. It is confusing that if the value is false, we
aluebs-webrtc 2016/05/13 02:04:38 The older components (that use to inherit from Pro
+ }
+
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
if (capture_nonlocked_.beamformer_enabled !=
config.Get<Beamforming>().enabled) {
@@ -704,7 +710,7 @@ int AudioProcessingImpl::ProcessStreamLocked() {
ca->CopyLowPassToReference();
}
public_submodules_->noise_suppression->ProcessCaptureAudio(ca);
- if (constants_.intelligibility_enabled) {
+ if (capture_nonlocked_.intelligibility_enabled) {
RTC_DCHECK(public_submodules_->noise_suppression->is_enabled());
RTC_DCHECK(public_submodules_->gain_control->is_enabled());
public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate(
@@ -902,7 +908,7 @@ int AudioProcessingImpl::ProcessReverseStreamLocked() {
ra->SplitIntoFrequencyBands();
}
- if (constants_.intelligibility_enabled) {
+ if (capture_nonlocked_.intelligibility_enabled) {
public_submodules_->intelligibility_enhancer->ProcessRenderAudio(
ra->split_channels_f(kBand0To8kHz), capture_nonlocked_.split_rate,
ra->num_channels());
@@ -1150,7 +1156,7 @@ bool AudioProcessingImpl::fwd_analysis_needed() const {
}
bool AudioProcessingImpl::is_rev_processed() const {
- return constants_.intelligibility_enabled;
+ return capture_nonlocked_.intelligibility_enabled;
}
bool AudioProcessingImpl::rev_synthesis_needed() const {
@@ -1215,7 +1221,7 @@ void AudioProcessingImpl::InitializeBeamformer() {
}
void AudioProcessingImpl::InitializeIntelligibility() {
- if (constants_.intelligibility_enabled) {
tommi 2016/05/12 07:06:38 This should be a dcheck and the function should do
aluebs-webrtc 2016/05/13 02:04:38 Please see explanation above.
+ if (capture_nonlocked_.intelligibility_enabled) {
public_submodules_->intelligibility_enhancer.reset(
new IntelligibilityEnhancer(capture_nonlocked_.split_rate,
render_.render_audio->num_channels(),

Powered by Google App Engine
This is Rietveld 408576698