| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 int err = ProcessingComponent::Initialize(); | 294 int err = ProcessingComponent::Initialize(); |
| 295 if (err != apm_->kNoError || !is_component_enabled()) { | 295 if (err != apm_->kNoError || !is_component_enabled()) { |
| 296 return err; | 296 return err; |
| 297 } | 297 } |
| 298 | 298 |
| 299 capture_levels_.assign(num_handles(), analog_capture_level_); | 299 capture_levels_.assign(num_handles(), analog_capture_level_); |
| 300 return apm_->kNoError; | 300 return apm_->kNoError; |
| 301 } | 301 } |
| 302 | 302 |
| 303 void* GainControlImpl::CreateHandle() const { | 303 void* GainControlImpl::CreateHandle() const { |
| 304 Handle* handle = NULL; | 304 return WebRtcAgc_Create(); |
| 305 if (WebRtcAgc_Create(&handle) != apm_->kNoError) { | |
| 306 handle = NULL; | |
| 307 } else { | |
| 308 assert(handle != NULL); | |
| 309 } | |
| 310 | |
| 311 return handle; | |
| 312 } | 305 } |
| 313 | 306 |
| 314 void GainControlImpl::DestroyHandle(void* handle) const { | 307 void GainControlImpl::DestroyHandle(void* handle) const { |
| 315 WebRtcAgc_Free(static_cast<Handle*>(handle)); | 308 WebRtcAgc_Free(static_cast<Handle*>(handle)); |
| 316 } | 309 } |
| 317 | 310 |
| 318 int GainControlImpl::InitializeHandle(void* handle) const { | 311 int GainControlImpl::InitializeHandle(void* handle) const { |
| 319 return WebRtcAgc_Init(static_cast<Handle*>(handle), | 312 return WebRtcAgc_Init(static_cast<Handle*>(handle), |
| 320 minimum_capture_level_, | 313 minimum_capture_level_, |
| 321 maximum_capture_level_, | 314 maximum_capture_level_, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 341 return apm_->num_output_channels(); | 334 return apm_->num_output_channels(); |
| 342 } | 335 } |
| 343 | 336 |
| 344 int GainControlImpl::GetHandleError(void* handle) const { | 337 int GainControlImpl::GetHandleError(void* handle) const { |
| 345 // The AGC has no get_error() function. | 338 // The AGC has no get_error() function. |
| 346 // (Despite listing errors in its interface...) | 339 // (Despite listing errors in its interface...) |
| 347 assert(handle != NULL); | 340 assert(handle != NULL); |
| 348 return apm_->kUnspecifiedError; | 341 return apm_->kUnspecifiedError; |
| 349 } | 342 } |
| 350 } // namespace webrtc | 343 } // namespace webrtc |
| OLD | NEW |