| 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 12 matching lines...) Expand all Loading... |
| 23 crit_(crit) {} | 23 crit_(crit) {} |
| 24 | 24 |
| 25 LevelEstimatorImpl::~LevelEstimatorImpl() {} | 25 LevelEstimatorImpl::~LevelEstimatorImpl() {} |
| 26 | 26 |
| 27 int LevelEstimatorImpl::ProcessStream(AudioBuffer* audio) { | 27 int LevelEstimatorImpl::ProcessStream(AudioBuffer* audio) { |
| 28 if (!is_component_enabled()) { | 28 if (!is_component_enabled()) { |
| 29 return AudioProcessing::kNoError; | 29 return AudioProcessing::kNoError; |
| 30 } | 30 } |
| 31 | 31 |
| 32 RMSLevel* rms_level = static_cast<RMSLevel*>(handle(0)); | 32 RMSLevel* rms_level = static_cast<RMSLevel*>(handle(0)); |
| 33 for (int i = 0; i < audio->num_channels(); ++i) { | 33 for (size_t i = 0; i < audio->num_channels(); ++i) { |
| 34 rms_level->Process(audio->channels_const()[i], | 34 rms_level->Process(audio->channels_const()[i], |
| 35 audio->num_frames()); | 35 audio->num_frames()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 return AudioProcessing::kNoError; | 38 return AudioProcessing::kNoError; |
| 39 } | 39 } |
| 40 | 40 |
| 41 int LevelEstimatorImpl::Enable(bool enable) { | 41 int LevelEstimatorImpl::Enable(bool enable) { |
| 42 CriticalSectionScoped crit_scoped(crit_); | 42 CriticalSectionScoped crit_scoped(crit_); |
| 43 return EnableComponent(enable); | 43 return EnableComponent(enable); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 68 | 68 |
| 69 int LevelEstimatorImpl::InitializeHandle(void* handle) const { | 69 int LevelEstimatorImpl::InitializeHandle(void* handle) const { |
| 70 static_cast<RMSLevel*>(handle)->Reset(); | 70 static_cast<RMSLevel*>(handle)->Reset(); |
| 71 return AudioProcessing::kNoError; | 71 return AudioProcessing::kNoError; |
| 72 } | 72 } |
| 73 | 73 |
| 74 int LevelEstimatorImpl::ConfigureHandle(void* /*handle*/) const { | 74 int LevelEstimatorImpl::ConfigureHandle(void* /*handle*/) const { |
| 75 return AudioProcessing::kNoError; | 75 return AudioProcessing::kNoError; |
| 76 } | 76 } |
| 77 | 77 |
| 78 int LevelEstimatorImpl::num_handles_required() const { | 78 size_t LevelEstimatorImpl::num_handles_required() const { |
| 79 return 1; | 79 return 1; |
| 80 } | 80 } |
| 81 | 81 |
| 82 int LevelEstimatorImpl::GetHandleError(void* /*handle*/) const { | 82 int LevelEstimatorImpl::GetHandleError(void* /*handle*/) const { |
| 83 return AudioProcessing::kUnspecifiedError; | 83 return AudioProcessing::kUnspecifiedError; |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace webrtc | 86 } // namespace webrtc |
| OLD | NEW |