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

Unified Diff: webrtc/voice_engine/output_mixer.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/output_mixer.h ('k') | webrtc/voice_engine/shared_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/output_mixer.cc
diff --git a/webrtc/voice_engine/output_mixer.cc b/webrtc/voice_engine/output_mixer.cc
index 0dacf35eafabb3744f48f7762f4c6095ff7565d1..aa50e0bf2be0ad06fb7c3c68bb7d922fde81d040 100644
--- a/webrtc/voice_engine/output_mixer.cc
+++ b/webrtc/voice_engine/output_mixer.cc
@@ -13,7 +13,6 @@
#include "webrtc/base/format_macros.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/modules/utility/include/audio_frame_operations.h"
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/system_wrappers/include/file_wrapper.h"
#include "webrtc/system_wrappers/include/trace.h"
#include "webrtc/voice_engine/include/voe_external_media.h"
@@ -68,7 +67,7 @@ void OutputMixer::RecordFileEnded(int32_t id)
"OutputMixer::RecordFileEnded(id=%d)", id);
assert(id == _instanceId);
- CriticalSectionScoped cs(&_fileCritSect);
+ rtc::CritScope cs(&_fileCritSect);
_outputFileRecording = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::RecordFileEnded() =>"
@@ -92,8 +91,6 @@ OutputMixer::Create(OutputMixer*& mixer, uint32_t instanceId)
}
OutputMixer::OutputMixer(uint32_t instanceId) :
- _callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
- _fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
_mixerModule(*AudioConferenceMixer::Create(instanceId)),
_audioLevel(),
_dtmfGenerator(instanceId),
@@ -138,7 +135,7 @@ OutputMixer::~OutputMixer()
DeRegisterExternalMediaProcessing();
}
{
- CriticalSectionScoped cs(&_fileCritSect);
+ rtc::CritScope cs(&_fileCritSect);
if (_outputFileRecorderPtr)
{
_outputFileRecorderPtr->RegisterModuleFileCallback(NULL);
@@ -149,8 +146,6 @@ OutputMixer::~OutputMixer()
}
_mixerModule.UnRegisterMixedStreamCallback();
delete &_mixerModule;
- delete &_callbackCritSect;
- delete &_fileCritSect;
}
int32_t
@@ -178,7 +173,7 @@ int OutputMixer::RegisterExternalMediaProcessing(
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::RegisterExternalMediaProcessing()");
- CriticalSectionScoped cs(&_callbackCritSect);
+ rtc::CritScope cs(&_callbackCritSect);
_externalMediaCallbackPtr = &proccess_object;
_externalMedia = true;
@@ -190,7 +185,7 @@ int OutputMixer::DeRegisterExternalMediaProcessing()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::DeRegisterExternalMediaProcessing()");
- CriticalSectionScoped cs(&_callbackCritSect);
+ rtc::CritScope cs(&_callbackCritSect);
_externalMedia = false;
_externalMediaCallbackPtr = NULL;
@@ -314,7 +309,7 @@ int OutputMixer::StartRecordingPlayout(const char* fileName,
format = kFileFormatCompressedFile;
}
- CriticalSectionScoped cs(&_fileCritSect);
+ rtc::CritScope cs(&_fileCritSect);
// Destroy the old instance
if (_outputFileRecorderPtr)
@@ -394,7 +389,7 @@ int OutputMixer::StartRecordingPlayout(OutStream* stream,
format = kFileFormatCompressedFile;
}
- CriticalSectionScoped cs(&_fileCritSect);
+ rtc::CritScope cs(&_fileCritSect);
// Destroy the old instance
if (_outputFileRecorderPtr)
@@ -445,7 +440,7 @@ int OutputMixer::StopRecordingPlayout()
return -1;
}
- CriticalSectionScoped cs(&_fileCritSect);
+ rtc::CritScope cs(&_fileCritSect);
if (_outputFileRecorderPtr->StopRecording() != 0)
{
@@ -472,7 +467,7 @@ int OutputMixer::GetMixedAudio(int sample_rate_hz,
// --- Record playout if enabled
{
- CriticalSectionScoped cs(&_fileCritSect);
+ rtc::CritScope cs(&_fileCritSect);
if (_outputFileRecording && _outputFileRecorderPtr)
_outputFileRecorderPtr->RecordAudioToFile(_audioFrame);
}
@@ -536,7 +531,7 @@ OutputMixer::DoOperationsOnCombinedSignal(bool feed_data_to_apm)
// --- External media processing
{
- CriticalSectionScoped cs(&_callbackCritSect);
+ rtc::CritScope cs(&_callbackCritSect);
if (_externalMedia)
{
const bool is_stereo = (_audioFrame.num_channels_ == 2);
« no previous file with comments | « webrtc/voice_engine/output_mixer.h ('k') | webrtc/voice_engine/shared_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698