Bug 1440040 - Properly apply microphone capture settings. r=padenot

MozReview-Commit-ID: 7TqYvHrltxm

--HG--
extra : rebase_source : 5a6d972c6e07b17737c17cfa4827cbe5352c852a
This commit is contained in:
Andreas Pehrson 2018-02-28 22:41:15 +01:00
parent 60f3567035
commit aecea2a024
2 changed files with 6 additions and 3 deletions

View File

@ -527,7 +527,7 @@ private:
void UpdateAGCSettingsIfNeeded(bool aEnable, webrtc::AgcModes aMode);
void UpdateNSSettingsIfNeeded(bool aEnable, webrtc::NsModes aMode);
void SetLastPrefs(const MediaEnginePrefs& aPrefs);
void ApplySettings(const MediaEnginePrefs& aPrefs);
bool HasEnabledTrack() const;

View File

@ -514,14 +514,14 @@ MediaEngineWebRTCMicrophoneSource::UpdateSingleSource(
config.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(mDelayAgnostic));
mAudioProcessing->SetExtraOptions(config);
}
SetLastPrefs(prefs);
mLastPrefs = prefs;
return NS_OK;
}
#undef HANDLE_APM_ERROR
void
MediaEngineWebRTCMicrophoneSource::SetLastPrefs(const MediaEnginePrefs& aPrefs)
MediaEngineWebRTCMicrophoneSource::ApplySettings(const MediaEnginePrefs& aPrefs)
{
AssertIsOnOwningThread();
@ -535,6 +535,7 @@ MediaEngineWebRTCMicrophoneSource::SetLastPrefs(const MediaEnginePrefs& aPrefs)
break;
}
}
MOZ_DIAGNOSTIC_ASSERT(graph);
NS_DispatchToMainThread(media::NewRunnableFrom([that, graph, aPrefs]() mutable {
that->mSettings->mEchoCancellation.Value() = aPrefs.mAecOn;
that->mSettings->mAutoGainControl.Value() = aPrefs.mAgcOn;
@ -711,6 +712,8 @@ MediaEngineWebRTCMicrophoneSource::Start(const RefPtr<const AllocationHandle>& a
mState = kStarted;
}
ApplySettings(mLastPrefs);
return NS_OK;
}