Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: webrtc/voice_engine/level_indicator.cc

Issue 1607353002: Swap use of CriticalSectionWrapper with rtc::CriticalSection in voice_engine/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix bug in monitor_module.cc Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/level_indicator.h ('k') | webrtc/voice_engine/monitor_module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/level_indicator.cc
diff --git a/webrtc/voice_engine/level_indicator.cc b/webrtc/voice_engine/level_indicator.cc
index 68a837edb9ea46f7049e5a4434f1a42c48d9a3a3..f44ea8e3f0e6cca496811a3248608cf6ef4bde26 100644
--- a/webrtc/voice_engine/level_indicator.cc
+++ b/webrtc/voice_engine/level_indicator.cc
@@ -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;
}
« no previous file with comments | « webrtc/voice_engine/level_indicator.h ('k') | webrtc/voice_engine/monitor_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698