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:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user