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

Unified Diff: webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc

Issue 2785673002: Remove more CriticalSectionWrappers. (Closed)
Patch Set: Created 3 years, 9 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
Index: webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
index e408f22066f30c15eaf2352753cc2a43905e0e35..a486ee5468d8b6fef929e2321e9ee940d8e86e02 100644
--- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
@@ -30,7 +30,6 @@ namespace webrtc
AudioDeviceLinuxPulse::AudioDeviceLinuxPulse(const int32_t id) :
_ptrAudioBuffer(NULL),
- _critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_timeEventRec(*EventWrapper::Create()),
_timeEventPlay(*EventWrapper::Create()),
_recStartEvent(*EventWrapper::Create()),
@@ -133,7 +132,6 @@ AudioDeviceLinuxPulse::~AudioDeviceLinuxPulse()
delete &_playStartEvent;
delete &_timeEventRec;
delete &_timeEventPlay;
- delete &_critSect;
}
void AudioDeviceLinuxPulse::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer)
@@ -751,7 +749,7 @@ int32_t AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
int32_t AudioDeviceLinuxPulse::SetAGC(bool enable)
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_AGC = enable;
return 0;
@@ -759,7 +757,7 @@ int32_t AudioDeviceLinuxPulse::SetAGC(bool enable)
bool AudioDeviceLinuxPulse::AGC() const
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
return _AGC;
}
@@ -1346,7 +1344,7 @@ int32_t AudioDeviceLinuxPulse::StartRecording()
if (kEventTimeout == _recStartEvent.Wait(10000))
{
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_startRec = false;
}
StopRecording();
@@ -1356,7 +1354,7 @@ int32_t AudioDeviceLinuxPulse::StartRecording()
}
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
if (_recording)
{
// The recording state is set by the audio thread after recording
@@ -1375,7 +1373,7 @@ int32_t AudioDeviceLinuxPulse::StartRecording()
int32_t AudioDeviceLinuxPulse::StopRecording()
{
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
if (!_recIsInitialized)
{
@@ -1469,7 +1467,7 @@ int32_t AudioDeviceLinuxPulse::StartPlayout()
// Set state to ensure that playout starts from the audio thread.
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_startPlay = true;
}
@@ -1481,7 +1479,7 @@ int32_t AudioDeviceLinuxPulse::StartPlayout()
if (kEventTimeout == _playStartEvent.Wait(10000))
{
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_startPlay = false;
}
StopPlayout();
@@ -1491,7 +1489,7 @@ int32_t AudioDeviceLinuxPulse::StartPlayout()
}
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
if (_playing)
{
// The playing state is set by the audio thread after playout
@@ -1510,7 +1508,7 @@ int32_t AudioDeviceLinuxPulse::StartPlayout()
int32_t AudioDeviceLinuxPulse::StopPlayout()
{
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
if (!_playIsInitialized)
{
@@ -1574,7 +1572,7 @@ int32_t AudioDeviceLinuxPulse::StopPlayout()
int32_t AudioDeviceLinuxPulse::PlayoutDelay(uint16_t& delayMS) const
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
delayMS = (uint16_t) _sndCardPlayDelay;
return 0;
}
@@ -1631,49 +1629,49 @@ int32_t AudioDeviceLinuxPulse::CPULoad(uint16_t& /*load*/) const
bool AudioDeviceLinuxPulse::PlayoutWarning() const
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
return (_playWarning > 0);
}
bool AudioDeviceLinuxPulse::PlayoutError() const
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
return (_playError > 0);
}
bool AudioDeviceLinuxPulse::RecordingWarning() const
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
return (_recWarning > 0);
}
bool AudioDeviceLinuxPulse::RecordingError() const
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
return (_recError > 0);
}
void AudioDeviceLinuxPulse::ClearPlayoutWarning()
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_playWarning = 0;
}
void AudioDeviceLinuxPulse::ClearPlayoutError()
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_playError = 0;
}
void AudioDeviceLinuxPulse::ClearRecordingWarning()
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_recWarning = 0;
}
void AudioDeviceLinuxPulse::ClearRecordingError()
{
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
_recError = 0;
}
@@ -2602,7 +2600,7 @@ bool AudioDeviceLinuxPulse::PlayThreadProcess()
return true;
}
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
if (_startPlay)
{
@@ -2843,7 +2841,7 @@ bool AudioDeviceLinuxPulse::RecThreadProcess()
return true;
}
- CriticalSectionScoped lock(&_critSect);
+ rtc::CritScope lock(&_critSect);
if (_startRec)
{

Powered by Google App Engine
This is Rietveld 408576698