Allow setting the AGC2 fixed gain during runtime

This CL extends the supported runtime settings in
APM to also comprise the AGC2 fixed gain.
The CL was originally created by Adam Whiteside.

Bug: webrtc:10574
Change-Id: I79b3d6501f1e202b66a9b6018f8a493a56b01f62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134101
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27782}
This commit is contained in:
Per Åhgren
2019-04-26 11:33:37 +02:00
committed by Commit Bot
parent 2a8bd090a3
commit 6ee75fdfcb
10 changed files with 112 additions and 28 deletions

View File

@ -391,6 +391,7 @@ class AudioProcessing : public rtc::RefCountInterface {
kNotSpecified,
kCapturePreGain,
kCaptureCompressionGain,
kCaptureFixedPostGain,
kCustomRenderProcessingRuntimeSetting
};
@ -410,6 +411,14 @@ class AudioProcessing : public rtc::RefCountInterface {
return {Type::kCaptureCompressionGain, static_cast<float>(gain_db)};
}
// Corresponds to Config::GainController2::fixed_digital::gain_db, but for
// runtime configuration.
static RuntimeSetting CreateCaptureFixedPostGain(float gain_db) {
RTC_DCHECK_GE(gain_db, 0.f);
RTC_DCHECK_LE(gain_db, 90.f);
return {Type::kCaptureFixedPostGain, gain_db};
}
static RuntimeSetting CreateCustomRenderSetting(float payload) {
return {Type::kCustomRenderProcessingRuntimeSetting, payload};
}