| Index: webrtc/modules/audio_processing/gain_control_impl.cc
|
| diff --git a/webrtc/modules/audio_processing/gain_control_impl.cc b/webrtc/modules/audio_processing/gain_control_impl.cc
|
| index 0eacd28686382c2bd8cffb17b340495915d47eb8..0f8dd88e532b982c841b3eb090ddbc88947eb10b 100644
|
| --- a/webrtc/modules/audio_processing/gain_control_impl.cc
|
| +++ b/webrtc/modules/audio_processing/gain_control_impl.cc
|
| @@ -43,11 +43,16 @@ static const size_t kMaxNumFramesToBuffer = 100;
|
|
|
| } // namespace
|
|
|
| -GainControlImpl::GainControlImpl(const AudioProcessing* apm,
|
| - CriticalSectionWrapper* crit)
|
| +GainControlImpl::GainControlImpl(
|
| + const AudioProcessing* apm,
|
| + CriticalSectionWrapper* crit,
|
| + const rtc::ThreadChecker* render_thread_checker,
|
| + const rtc::ThreadChecker* capture_thread_checker)
|
| : ProcessingComponent(),
|
| apm_(apm),
|
| crit_(crit),
|
| + render_thread_checker_(render_thread_checker),
|
| + capture_thread_checker_(capture_thread_checker),
|
| mode_(kAdaptiveAnalog),
|
| minimum_capture_level_(0),
|
| maximum_capture_level_(255),
|
| @@ -62,6 +67,7 @@ GainControlImpl::GainControlImpl(const AudioProcessing* apm,
|
| GainControlImpl::~GainControlImpl() {}
|
|
|
| int GainControlImpl::ProcessRenderAudio(AudioBuffer* audio) {
|
| + RTC_DCHECK(render_thread_checker_->CalledOnValidThread());
|
| if (!is_component_enabled()) {
|
| return apm_->kNoError;
|
| }
|
| @@ -220,6 +226,7 @@ int GainControlImpl::ProcessCaptureAudio(AudioBuffer* audio) {
|
|
|
| // TODO(ajm): ensure this is called under kAdaptiveAnalog.
|
| int GainControlImpl::set_stream_analog_level(int level) {
|
| + RTC_DCHECK(capture_thread_checker_->CalledOnValidThread());
|
| CriticalSectionScoped crit_scoped(crit_);
|
| was_analog_level_set_ = true;
|
| if (level < minimum_capture_level_ || level > maximum_capture_level_) {
|
| @@ -231,6 +238,7 @@ int GainControlImpl::set_stream_analog_level(int level) {
|
| }
|
|
|
| int GainControlImpl::stream_analog_level() {
|
| + RTC_DCHECK(capture_thread_checker_->CalledOnValidThread());
|
| // TODO(ajm): enable this assertion?
|
| //assert(mode_ == kAdaptiveAnalog);
|
|
|
|
|