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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 RTC_DCHECK(num_proc_channels_); | 310 RTC_DCHECK(num_proc_channels_); |
311 RTC_DCHECK(sample_rate_hz_); | 311 RTC_DCHECK(sample_rate_hz_); |
312 Initialize(*num_proc_channels_, *sample_rate_hz_); | 312 Initialize(*num_proc_channels_, *sample_rate_hz_); |
313 } else { | 313 } else { |
314 enabled_ = enable; | 314 enabled_ = enable; |
315 } | 315 } |
316 return AudioProcessing::kNoError; | 316 return AudioProcessing::kNoError; |
317 } | 317 } |
318 | 318 |
319 bool GainControlImpl::is_enabled_render_side_query() const { | |
320 // TODO(peah): Add threadchecker. | |
321 rtc::CritScope cs(crit_render_); | |
322 return enabled_; | |
323 } | |
324 | |
325 bool GainControlImpl::is_enabled() const { | 319 bool GainControlImpl::is_enabled() const { |
326 rtc::CritScope cs(crit_capture_); | 320 rtc::CritScope cs(crit_capture_); |
327 return enabled_; | 321 return enabled_; |
328 } | 322 } |
329 | 323 |
330 int GainControlImpl::set_mode(Mode mode) { | 324 int GainControlImpl::set_mode(Mode mode) { |
331 rtc::CritScope cs_render(crit_render_); | 325 rtc::CritScope cs_render(crit_render_); |
332 rtc::CritScope cs_capture(crit_capture_); | 326 rtc::CritScope cs_capture(crit_capture_); |
333 if (MapSetting(mode) == -1) { | 327 if (MapSetting(mode) == -1) { |
334 return AudioProcessing::kBadParameterError; | 328 return AudioProcessing::kBadParameterError; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 for (auto& gain_controller : gain_controllers_) { | 493 for (auto& gain_controller : gain_controllers_) { |
500 const int handle_error = | 494 const int handle_error = |
501 WebRtcAgc_set_config(gain_controller->state(), config); | 495 WebRtcAgc_set_config(gain_controller->state(), config); |
502 if (handle_error != AudioProcessing::kNoError) { | 496 if (handle_error != AudioProcessing::kNoError) { |
503 error = handle_error; | 497 error = handle_error; |
504 } | 498 } |
505 } | 499 } |
506 return error; | 500 return error; |
507 } | 501 } |
508 } // namespace webrtc | 502 } // namespace webrtc |
OLD | NEW |