diff --git a/src/modules/utility/source/file_player_impl.cc b/src/modules/utility/source/file_player_impl.cc index 9e3f02fff..f5eb9b857 100644 --- a/src/modules/utility/source/file_player_impl.cc +++ b/src/modules/utility/source/file_player_impl.cc @@ -464,7 +464,7 @@ VideoFilePlayerImpl::VideoFilePlayerImpl(WebRtc_UWord32 instanceID, _decodedVideoFrames(0), _encodedData(*new EncodedVideoData()), _frameScaler(*new FrameScaler()), - _critSec(*CriticalSectionWrapper::CreateCriticalSection()), + _critSec(CriticalSectionWrapper::CreateCriticalSection()), _accumulatedRenderTimeMs(0), _numberOfFramesRead(0), _videoOnly(false) @@ -474,7 +474,7 @@ VideoFilePlayerImpl::VideoFilePlayerImpl(WebRtc_UWord32 instanceID, VideoFilePlayerImpl::~VideoFilePlayerImpl() { - delete &_critSec; + delete _critSec; delete &_frameScaler; delete &_videoDecoder; delete &_encodedData; diff --git a/src/modules/utility/source/file_player_impl.h b/src/modules/utility/source/file_player_impl.h index bd8286172..8b9f6ae73 100644 --- a/src/modules/utility/source/file_player_impl.h +++ b/src/modules/utility/source/file_player_impl.h @@ -110,7 +110,7 @@ private: EncodedVideoData& _encodedData; FrameScaler& _frameScaler; - CriticalSectionWrapper& _critSec; + CriticalSectionWrapper* _critSec; TickTime _startTime; WebRtc_Word64 _accumulatedRenderTimeMs; WebRtc_UWord32 _frameLengthMS; diff --git a/src/modules/utility/source/file_recorder_impl.cc b/src/modules/utility/source/file_recorder_impl.cc index c0a3a9d47..192244297 100644 --- a/src/modules/utility/source/file_recorder_impl.cc +++ b/src/modules/utility/source/file_recorder_impl.cc @@ -351,7 +351,7 @@ AviRecorder::AviRecorder(WebRtc_UWord32 instanceID, FileFormats fileFormat) _videoOnly(false), _thread( 0), _timeEvent(*EventWrapper::Create()), - _critSec(*CriticalSectionWrapper::CreateCriticalSection()), + _critSec(CriticalSectionWrapper::CreateCriticalSection()), _writtenVideoFramesCounter(0), _writtenAudioMS(0), _writtenVideoMS(0) @@ -372,7 +372,7 @@ AviRecorder::~AviRecorder( ) delete _videoFramesQueue; delete _thread; delete &_timeEvent; - delete &_critSec; + delete _critSec; } WebRtc_Word32 AviRecorder::StartRecordingVideoFile( @@ -484,7 +484,7 @@ bool AviRecorder::StartThread() bool AviRecorder::StopThread() { - _critSec.Enter(); + _critSec->Enter(); if(_thread) { @@ -495,7 +495,7 @@ bool AviRecorder::StopThread() _timeEvent.Set(); - _critSec.Leave(); + _critSec->Leave(); if(thread->Stop()) { @@ -504,7 +504,7 @@ bool AviRecorder::StopThread() return false; } } else { - _critSec.Leave(); + _critSec->Leave(); } return true; } diff --git a/src/modules/utility/source/file_recorder_impl.h b/src/modules/utility/source/file_recorder_impl.h index 6b32b3076..0bb2a9091 100644 --- a/src/modules/utility/source/file_recorder_impl.h +++ b/src/modules/utility/source/file_recorder_impl.h @@ -154,7 +154,7 @@ private: ThreadWrapper* _thread; EventWrapper& _timeEvent; - CriticalSectionWrapper& _critSec; + CriticalSectionWrapper* _critSec; WebRtc_Word64 _writtenVideoFramesCounter; WebRtc_Word64 _writtenAudioMS; WebRtc_Word64 _writtenVideoMS; diff --git a/src/modules/utility/source/process_thread_impl.cc b/src/modules/utility/source/process_thread_impl.cc index 57fe1cd0e..356029445 100644 --- a/src/modules/utility/source/process_thread_impl.cc +++ b/src/modules/utility/source/process_thread_impl.cc @@ -31,7 +31,7 @@ void ProcessThread::DestroyProcessThread(ProcessThread* module) ProcessThreadImpl::ProcessThreadImpl() : _timeEvent(*EventWrapper::Create()), - _critSectModules(*CriticalSectionWrapper::CreateCriticalSection()), + _critSectModules(CriticalSectionWrapper::CreateCriticalSection()), _thread(NULL) { WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s created", __FUNCTION__); @@ -39,7 +39,7 @@ ProcessThreadImpl::ProcessThreadImpl() ProcessThreadImpl::~ProcessThreadImpl() { - delete &_critSectModules; + delete _critSectModules; delete &_timeEvent; WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__); } @@ -66,7 +66,7 @@ WebRtc_Word32 ProcessThreadImpl::Start() WebRtc_Word32 ProcessThreadImpl::Stop() { - _critSectModules.Enter(); + _critSectModules->Enter(); if(_thread) { _thread->SetNotAlive(); @@ -75,7 +75,7 @@ WebRtc_Word32 ProcessThreadImpl::Stop() _thread = NULL; _timeEvent.Set(); - _critSectModules.Leave(); + _critSectModules->Leave(); if(thread->Stop()) { @@ -84,7 +84,7 @@ WebRtc_Word32 ProcessThreadImpl::Stop() return -1; } } else { - _critSectModules.Leave(); + _critSectModules->Leave(); } return 0; } diff --git a/src/modules/utility/source/process_thread_impl.h b/src/modules/utility/source/process_thread_impl.h index a712ffc06..79b12725d 100644 --- a/src/modules/utility/source/process_thread_impl.h +++ b/src/modules/utility/source/process_thread_impl.h @@ -38,7 +38,7 @@ protected: private: EventWrapper& _timeEvent; - CriticalSectionWrapper& _critSectModules; + CriticalSectionWrapper* _critSectModules; ListWrapper _modules; ThreadWrapper* _thread; }; diff --git a/src/modules/utility/source/rtp_dump_impl.cc b/src/modules/utility/source/rtp_dump_impl.cc index 6ba0c0ba9..8a90727de 100644 --- a/src/modules/utility/source/rtp_dump_impl.cc +++ b/src/modules/utility/source/rtp_dump_impl.cc @@ -69,7 +69,7 @@ void RtpDump::DestroyRtpDump(RtpDump* object) } RtpDumpImpl::RtpDumpImpl() - : _critSect(*CriticalSectionWrapper::CreateCriticalSection()), + : _critSect(CriticalSectionWrapper::CreateCriticalSection()), _file(*FileWrapper::Create()), _startTime(0) { @@ -85,7 +85,7 @@ RtpDumpImpl::~RtpDumpImpl() _file.Flush(); _file.CloseFile(); delete &_file; - delete &_critSect; + delete _critSect; WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__); } diff --git a/src/modules/utility/source/rtp_dump_impl.h b/src/modules/utility/source/rtp_dump_impl.h index a84e5985b..28b5a70bf 100644 --- a/src/modules/utility/source/rtp_dump_impl.h +++ b/src/modules/utility/source/rtp_dump_impl.h @@ -41,7 +41,7 @@ private: bool RTCP(const WebRtc_UWord8* packet) const; private: - CriticalSectionWrapper& _critSect; + CriticalSectionWrapper* _critSect; FileWrapper& _file; WebRtc_UWord32 _startTime; };