Removed usage of the deprecated critical section constructor in modules/utility.

Review URL: http://webrtc-codereview.appspot.com/321006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1223 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2011-12-16 19:53:46 +00:00
parent 57353a33f1
commit 105e07193e
8 changed files with 18 additions and 18 deletions

View File

@ -464,7 +464,7 @@ VideoFilePlayerImpl::VideoFilePlayerImpl(WebRtc_UWord32 instanceID,
_decodedVideoFrames(0), _decodedVideoFrames(0),
_encodedData(*new EncodedVideoData()), _encodedData(*new EncodedVideoData()),
_frameScaler(*new FrameScaler()), _frameScaler(*new FrameScaler()),
_critSec(*CriticalSectionWrapper::CreateCriticalSection()), _critSec(CriticalSectionWrapper::CreateCriticalSection()),
_accumulatedRenderTimeMs(0), _accumulatedRenderTimeMs(0),
_numberOfFramesRead(0), _numberOfFramesRead(0),
_videoOnly(false) _videoOnly(false)
@ -474,7 +474,7 @@ VideoFilePlayerImpl::VideoFilePlayerImpl(WebRtc_UWord32 instanceID,
VideoFilePlayerImpl::~VideoFilePlayerImpl() VideoFilePlayerImpl::~VideoFilePlayerImpl()
{ {
delete &_critSec; delete _critSec;
delete &_frameScaler; delete &_frameScaler;
delete &_videoDecoder; delete &_videoDecoder;
delete &_encodedData; delete &_encodedData;

View File

@ -110,7 +110,7 @@ private:
EncodedVideoData& _encodedData; EncodedVideoData& _encodedData;
FrameScaler& _frameScaler; FrameScaler& _frameScaler;
CriticalSectionWrapper& _critSec; CriticalSectionWrapper* _critSec;
TickTime _startTime; TickTime _startTime;
WebRtc_Word64 _accumulatedRenderTimeMs; WebRtc_Word64 _accumulatedRenderTimeMs;
WebRtc_UWord32 _frameLengthMS; WebRtc_UWord32 _frameLengthMS;

View File

@ -351,7 +351,7 @@ AviRecorder::AviRecorder(WebRtc_UWord32 instanceID, FileFormats fileFormat)
_videoOnly(false), _videoOnly(false),
_thread( 0), _thread( 0),
_timeEvent(*EventWrapper::Create()), _timeEvent(*EventWrapper::Create()),
_critSec(*CriticalSectionWrapper::CreateCriticalSection()), _critSec(CriticalSectionWrapper::CreateCriticalSection()),
_writtenVideoFramesCounter(0), _writtenVideoFramesCounter(0),
_writtenAudioMS(0), _writtenAudioMS(0),
_writtenVideoMS(0) _writtenVideoMS(0)
@ -372,7 +372,7 @@ AviRecorder::~AviRecorder( )
delete _videoFramesQueue; delete _videoFramesQueue;
delete _thread; delete _thread;
delete &_timeEvent; delete &_timeEvent;
delete &_critSec; delete _critSec;
} }
WebRtc_Word32 AviRecorder::StartRecordingVideoFile( WebRtc_Word32 AviRecorder::StartRecordingVideoFile(
@ -484,7 +484,7 @@ bool AviRecorder::StartThread()
bool AviRecorder::StopThread() bool AviRecorder::StopThread()
{ {
_critSec.Enter(); _critSec->Enter();
if(_thread) if(_thread)
{ {
@ -495,7 +495,7 @@ bool AviRecorder::StopThread()
_timeEvent.Set(); _timeEvent.Set();
_critSec.Leave(); _critSec->Leave();
if(thread->Stop()) if(thread->Stop())
{ {
@ -504,7 +504,7 @@ bool AviRecorder::StopThread()
return false; return false;
} }
} else { } else {
_critSec.Leave(); _critSec->Leave();
} }
return true; return true;
} }

View File

@ -154,7 +154,7 @@ private:
ThreadWrapper* _thread; ThreadWrapper* _thread;
EventWrapper& _timeEvent; EventWrapper& _timeEvent;
CriticalSectionWrapper& _critSec; CriticalSectionWrapper* _critSec;
WebRtc_Word64 _writtenVideoFramesCounter; WebRtc_Word64 _writtenVideoFramesCounter;
WebRtc_Word64 _writtenAudioMS; WebRtc_Word64 _writtenAudioMS;
WebRtc_Word64 _writtenVideoMS; WebRtc_Word64 _writtenVideoMS;

View File

@ -31,7 +31,7 @@ void ProcessThread::DestroyProcessThread(ProcessThread* module)
ProcessThreadImpl::ProcessThreadImpl() ProcessThreadImpl::ProcessThreadImpl()
: _timeEvent(*EventWrapper::Create()), : _timeEvent(*EventWrapper::Create()),
_critSectModules(*CriticalSectionWrapper::CreateCriticalSection()), _critSectModules(CriticalSectionWrapper::CreateCriticalSection()),
_thread(NULL) _thread(NULL)
{ {
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s created", __FUNCTION__); WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s created", __FUNCTION__);
@ -39,7 +39,7 @@ ProcessThreadImpl::ProcessThreadImpl()
ProcessThreadImpl::~ProcessThreadImpl() ProcessThreadImpl::~ProcessThreadImpl()
{ {
delete &_critSectModules; delete _critSectModules;
delete &_timeEvent; delete &_timeEvent;
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__); WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__);
} }
@ -66,7 +66,7 @@ WebRtc_Word32 ProcessThreadImpl::Start()
WebRtc_Word32 ProcessThreadImpl::Stop() WebRtc_Word32 ProcessThreadImpl::Stop()
{ {
_critSectModules.Enter(); _critSectModules->Enter();
if(_thread) if(_thread)
{ {
_thread->SetNotAlive(); _thread->SetNotAlive();
@ -75,7 +75,7 @@ WebRtc_Word32 ProcessThreadImpl::Stop()
_thread = NULL; _thread = NULL;
_timeEvent.Set(); _timeEvent.Set();
_critSectModules.Leave(); _critSectModules->Leave();
if(thread->Stop()) if(thread->Stop())
{ {
@ -84,7 +84,7 @@ WebRtc_Word32 ProcessThreadImpl::Stop()
return -1; return -1;
} }
} else { } else {
_critSectModules.Leave(); _critSectModules->Leave();
} }
return 0; return 0;
} }

View File

@ -38,7 +38,7 @@ protected:
private: private:
EventWrapper& _timeEvent; EventWrapper& _timeEvent;
CriticalSectionWrapper& _critSectModules; CriticalSectionWrapper* _critSectModules;
ListWrapper _modules; ListWrapper _modules;
ThreadWrapper* _thread; ThreadWrapper* _thread;
}; };

View File

@ -69,7 +69,7 @@ void RtpDump::DestroyRtpDump(RtpDump* object)
} }
RtpDumpImpl::RtpDumpImpl() RtpDumpImpl::RtpDumpImpl()
: _critSect(*CriticalSectionWrapper::CreateCriticalSection()), : _critSect(CriticalSectionWrapper::CreateCriticalSection()),
_file(*FileWrapper::Create()), _file(*FileWrapper::Create()),
_startTime(0) _startTime(0)
{ {
@ -85,7 +85,7 @@ RtpDumpImpl::~RtpDumpImpl()
_file.Flush(); _file.Flush();
_file.CloseFile(); _file.CloseFile();
delete &_file; delete &_file;
delete &_critSect; delete _critSect;
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__); WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__);
} }

View File

@ -41,7 +41,7 @@ private:
bool RTCP(const WebRtc_UWord8* packet) const; bool RTCP(const WebRtc_UWord8* packet) const;
private: private:
CriticalSectionWrapper& _critSect; CriticalSectionWrapper* _critSect;
FileWrapper& _file; FileWrapper& _file;
WebRtc_UWord32 _startTime; WebRtc_UWord32 _startTime;
}; };