OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 RTC_DCHECK(num_proc_channels_); | 304 RTC_DCHECK(num_proc_channels_); |
305 RTC_DCHECK(sample_rate_hz_); | 305 RTC_DCHECK(sample_rate_hz_); |
306 Initialize(*num_proc_channels_, *sample_rate_hz_); | 306 Initialize(*num_proc_channels_, *sample_rate_hz_); |
307 } else { | 307 } else { |
308 enabled_ = enable; | 308 enabled_ = enable; |
309 } | 309 } |
310 return AudioProcessing::kNoError; | 310 return AudioProcessing::kNoError; |
311 } | 311 } |
312 | 312 |
| 313 bool GainControlImpl::is_enabled_render_side_query() const { |
| 314 // TODO(peah): Add threadchecker. |
| 315 rtc::CritScope cs(crit_render_); |
| 316 return enabled_; |
| 317 } |
| 318 |
313 bool GainControlImpl::is_enabled() const { | 319 bool GainControlImpl::is_enabled() const { |
314 rtc::CritScope cs(crit_capture_); | 320 rtc::CritScope cs(crit_capture_); |
315 return enabled_; | 321 return enabled_; |
316 } | 322 } |
317 | 323 |
318 int GainControlImpl::set_mode(Mode mode) { | 324 int GainControlImpl::set_mode(Mode mode) { |
319 rtc::CritScope cs_render(crit_render_); | 325 rtc::CritScope cs_render(crit_render_); |
320 rtc::CritScope cs_capture(crit_capture_); | 326 rtc::CritScope cs_capture(crit_capture_); |
321 if (MapSetting(mode) == -1) { | 327 if (MapSetting(mode) == -1) { |
322 return AudioProcessing::kBadParameterError; | 328 return AudioProcessing::kBadParameterError; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 for (auto& gain_controller : gain_controllers_) { | 498 for (auto& gain_controller : gain_controllers_) { |
493 const int handle_error = | 499 const int handle_error = |
494 WebRtcAgc_set_config(gain_controller->state(), config); | 500 WebRtcAgc_set_config(gain_controller->state(), config); |
495 if (handle_error != AudioProcessing::kNoError) { | 501 if (handle_error != AudioProcessing::kNoError) { |
496 error = handle_error; | 502 error = handle_error; |
497 } | 503 } |
498 } | 504 } |
499 return error; | 505 return error; |
500 } | 506 } |
501 } // namespace webrtc | 507 } // namespace webrtc |
OLD | NEW |