Swap use of CriticalSectionWrapper with rtc::CriticalSection in voice_engine/

Also remove mischievous tab character!
This is a part of getting rid of CriticalSectionWrapper and makes the code slightly simpler.

BUG=

Review URL: https://codereview.webrtc.org/1607353002

Cr-Commit-Position: refs/heads/master@{#11346}
This commit is contained in:
tommi
2016-01-21 10:37:37 -08:00
committed by Commit bot
parent 8947a01e05
commit 31fc21f454
39 changed files with 232 additions and 293 deletions

View File

@ -10,7 +10,6 @@
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/voice_engine/level_indicator.h"
namespace webrtc {
@ -25,7 +24,6 @@ const int8_t permutation[33] =
AudioLevel::AudioLevel() :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_absMax(0),
_count(0),
_currentLevel(0),
@ -33,12 +31,11 @@ AudioLevel::AudioLevel() :
}
AudioLevel::~AudioLevel() {
delete &_critSect;
}
void AudioLevel::Clear()
{
CriticalSectionScoped cs(&_critSect);
rtc::CritScope cs(&_critSect);
_absMax = 0;
_count = 0;
_currentLevel = 0;
@ -56,7 +53,7 @@ void AudioLevel::ComputeLevel(const AudioFrame& audioFrame)
// Protect member access using a lock since this method is called on a
// dedicated audio thread in the RecordedDataIsAvailable() callback.
CriticalSectionScoped cs(&_critSect);
rtc::CritScope cs(&_critSect);
if (absValue > _absMax)
_absMax = absValue;
@ -88,13 +85,13 @@ void AudioLevel::ComputeLevel(const AudioFrame& audioFrame)
int8_t AudioLevel::Level() const
{
CriticalSectionScoped cs(&_critSect);
rtc::CritScope cs(&_critSect);
return _currentLevel;
}
int16_t AudioLevel::LevelFullRange() const
{
CriticalSectionScoped cs(&_critSect);
rtc::CritScope cs(&_critSect);
return _currentLevelFullRange;
}