VoiceEngine now uses pointer constructor of CriticalSectionScoped, instead of reference.

BUG=184
TEST=Compiles on all platforms.

Review URL: https://webrtc-codereview.appspot.com/436001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1853 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2012-03-07 08:12:21 +00:00
parent 1d27039612
commit 9a065d1eae
13 changed files with 153 additions and 156 deletions

View File

@ -85,7 +85,7 @@ Channel::InFrameType(WebRtc_Word16 frameType)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::InFrameType(frameType=%d)", frameType);
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
// 1 indicates speech
_sendFrameType = (frameType == 1) ? 1 : 0;
return 0;
@ -101,7 +101,7 @@ Channel::IncomingDtmf(const WebRtc_UWord8 digitDtmf, const bool end)
if (digitDtmf != 999)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_telephoneEventDetectionPtr)
{
_telephoneEventDetectionPtr->OnReceivedTelephoneEventInband(
@ -119,7 +119,7 @@ Channel::OnRxVadDetected(const int vadDecision)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::OnRxVadDetected(vadDecision=%d)", vadDecision);
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rxVadObserverPtr)
{
_rxVadObserverPtr->OnRxVad(_channelId, vadDecision);
@ -174,7 +174,7 @@ Channel::SendPacket(int channel, const void *data, int len)
// SRTP or External encryption
if (_encrypting)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_encryptionPtr)
{
@ -224,7 +224,7 @@ Channel::SendPacket(int channel, const void *data, int len)
// Packet transmission using external transport transport
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
int n = _transportPtr->SendPacket(channel,
bufferToSendPtr,
@ -251,7 +251,7 @@ Channel::SendRTCPPacket(int channel, const void *data, int len)
"Channel::SendRTCPPacket(channel=%d, len=%d)", channel, len);
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_transportPtr == NULL)
{
WEBRTC_TRACE(kTraceError, kTraceVoice,
@ -276,7 +276,7 @@ Channel::SendRTCPPacket(int channel, const void *data, int len)
// SRTP or External encryption
if (_encrypting)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_encryptionPtr)
{
@ -327,7 +327,7 @@ Channel::SendRTCPPacket(int channel, const void *data, int len)
// Packet transmission using external transport transport
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
int n = _transportPtr->SendRTCPPacket(channel,
bufferToSendPtr,
@ -371,7 +371,7 @@ Channel::IncomingRTPPacket(const WebRtc_Word8* incomingRtpPacket,
// SRTP or External decryption
if (_decrypting)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_encryptionPtr)
{
@ -451,7 +451,7 @@ Channel::IncomingRTCPPacket(const WebRtc_Word8* incomingRtcpPacket,
// SRTP or External decryption
if (_decrypting)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_encryptionPtr)
{
@ -515,7 +515,7 @@ Channel::OnReceivedTelephoneEvent(const WebRtc_Word32 id,
#ifdef WEBRTC_DTMF_DETECTION
if (_outOfBandTelephoneEventDetecion)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_telephoneEventDetectionPtr)
{
@ -567,7 +567,7 @@ Channel::OnIncomingSSRCChanged(const WebRtc_Word32 id,
if (_rtpObserver)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtpObserverPtr)
{
@ -590,7 +590,7 @@ void Channel::OnIncomingCSRCChanged(const WebRtc_Word32 id,
if (_rtpObserver)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtpObserverPtr)
{
@ -616,7 +616,7 @@ Channel::OnApplicationDataReceived(const WebRtc_Word32 id,
if (_rtcpObserver)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtcpObserverPtr)
{
@ -677,7 +677,7 @@ Channel::OnPacketTimeout(const WebRtc_Word32 id)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::OnPacketTimeout(id=%d)", id);
CriticalSectionScoped cs(*_callbackCritSectPtr);
CriticalSectionScoped cs(_callbackCritSectPtr);
if (_voiceEngineObserverPtr)
{
if (_receiving || _externalTransport)
@ -711,7 +711,7 @@ Channel::OnReceivedPacket(const WebRtc_Word32 id,
// Notify only for the case when we have restarted an RTP session.
if (_rtpPacketTimedOut && (kPacketRtp == packetType))
{
CriticalSectionScoped cs(*_callbackCritSectPtr);
CriticalSectionScoped cs(_callbackCritSectPtr);
if (_voiceEngineObserverPtr)
{
WebRtc_Word32 channel = VoEChannelId(id);
@ -772,7 +772,7 @@ Channel::OnPeriodicDeadOrAlive(const WebRtc_Word32 id,
// Send callback to the registered observer
if (_connectionObserver)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_connectionObserverPtr)
{
_connectionObserverPtr->OnPeriodicDeadOrAlive(channel, isAlive);
@ -898,7 +898,7 @@ WebRtc_Word32 Channel::GetAudioFrame(const WebRtc_Word32 id,
// External media
if (_outputExternalMedia)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
const bool isStereo = (audioFrame._audioChannel == 2);
if (_outputExternalMediaCallbackPtr)
{
@ -914,7 +914,7 @@ WebRtc_Word32 Channel::GetAudioFrame(const WebRtc_Word32 id,
// Record playout if enabled
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFileRecording && _outputFileRecorderPtr)
{
@ -968,7 +968,7 @@ Channel::NeededFrequency(const WebRtc_Word32 id)
// limit the spectrum anyway.
if (_outputFilePlaying)
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFilePlayerPtr && _outputFilePlaying)
{
if(_outputFilePlayerPtr->Frequency()>highestNeeded)
@ -1032,7 +1032,7 @@ Channel::PlayFileEnded(const WebRtc_Word32 id)
if (id == _inputFilePlayerId)
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
_inputFilePlaying = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
@ -1042,7 +1042,7 @@ Channel::PlayFileEnded(const WebRtc_Word32 id)
}
else if (id == _outputFilePlayerId)
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
_outputFilePlaying = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
@ -1060,7 +1060,7 @@ Channel::RecordFileEnded(const WebRtc_Word32 id)
assert(id == _outputFileRecorderId);
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
_outputFileRecording = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
@ -1073,7 +1073,6 @@ Channel::Channel(const WebRtc_Word32 channelId,
const WebRtc_UWord32 instanceId) :
_fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
_callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
_transmitCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
_instanceId(instanceId),
_channelId(channelId),
_rtpRtcpModule(*RtpRtcp::CreateRtpRtcp(VoEModuleId(
@ -1220,7 +1219,7 @@ Channel::~Channel()
StopPlayout();
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_inputFilePlayerPtr)
{
_inputFilePlayerPtr->RegisterModuleFileCallback(NULL);
@ -1352,7 +1351,6 @@ Channel::~Channel()
delete [] _encryptionRTCPBufferPtr;
delete [] _decryptionRTCPBufferPtr;
delete &_callbackCritSect;
delete &_transmitCritSect;
delete &_fileCritSect;
}
@ -1530,7 +1528,7 @@ Channel::Init()
{
// A lock is needed here since users can call
// RegisterExternalTransport() at the same time.
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
_transportPtr = &_socketTransportModule;
}
#endif
@ -1689,7 +1687,7 @@ Channel::StartSend()
{
// A lock is needed because |_sending| can be accessed or modified by
// another thread at the same time.
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_sending)
{
@ -1703,7 +1701,7 @@ Channel::StartSend()
_engineStatisticsPtr->SetLastError(
VE_RTP_RTCP_MODULE_ERROR, kTraceError,
"StartSend() RTP/RTCP failed to start sending");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
_sending = false;
return -1;
}
@ -1719,7 +1717,7 @@ Channel::StopSend()
{
// A lock is needed because |_sending| can be accessed or modified by
// another thread at the same time.
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_sending)
{
@ -2252,7 +2250,7 @@ Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterVoiceEngineObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserverPtr)
{
@ -2270,7 +2268,7 @@ Channel::DeRegisterVoiceEngineObserver()
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterVoiceEngineObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_voiceEngineObserverPtr)
{
@ -2769,7 +2767,7 @@ WebRtc_Word32 Channel::RegisterExternalTransport(Transport& transport)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::RegisterExternalTransport()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
#ifndef WEBRTC_EXTERNAL_TRANSPORT
// Sanity checks for default (non external transport) to avoid conflict with
@ -2807,7 +2805,7 @@ Channel::DeRegisterExternalTransport()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterExternalTransport()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_transportPtr)
{
@ -3252,7 +3250,7 @@ Channel::RegisterDeadOrAliveObserver(VoEConnectionObserver& observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterDeadOrAliveObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_connectionObserverPtr)
{
@ -3272,7 +3270,7 @@ Channel::DeRegisterDeadOrAliveObserver()
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterDeadOrAliveObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_connectionObserverPtr)
{
@ -3425,7 +3423,7 @@ int Channel::StartPlayingFileLocally(const char* fileName,
}
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFilePlayerPtr)
{
@ -3473,7 +3471,7 @@ int Channel::StartPlayingFileLocally(const char* fileName,
// the file, _fileCritSect will be taken. This would result in a deadlock.
if (_outputMixerPtr->SetAnonymousMixabilityStatus(*this, true) != 0)
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
_outputFilePlaying = false;
_engineStatisticsPtr->SetLastError(
VE_AUDIO_CONF_MIX_MODULE_ERROR, kTraceError,
@ -3517,7 +3515,7 @@ int Channel::StartPlayingFileLocally(InStream* stream,
}
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_outputFilePlayerPtr)
@ -3563,7 +3561,7 @@ int Channel::StartPlayingFileLocally(InStream* stream,
// StartPlayingFileLocally(const char* ...) for more details.
if (_outputMixerPtr->SetAnonymousMixabilityStatus(*this, true) != 0)
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
_outputFilePlaying = false;
_engineStatisticsPtr->SetLastError(
VE_AUDIO_CONF_MIX_MODULE_ERROR, kTraceError,
@ -3591,7 +3589,7 @@ int Channel::StopPlayingFileLocally()
}
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFilePlayerPtr->StopPlayingFile() != 0)
{
@ -3633,7 +3631,7 @@ int Channel::ScaleLocalFilePlayout(const float scale)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::ScaleLocalFilePlayout(scale=%5.3f)", scale);
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (!_outputFilePlaying)
{
@ -3661,7 +3659,7 @@ int Channel::GetLocalPlayoutPosition(int& positionMs)
WebRtc_UWord32 position;
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFilePlayerPtr == NULL)
{
@ -3705,7 +3703,7 @@ int Channel::StartPlayingFileAsMicrophone(const char* fileName,
return 0;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_inputFilePlayerPtr)
@ -3780,7 +3778,7 @@ int Channel::StartPlayingFileAsMicrophone(InStream* stream,
return 0;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_inputFilePlayerPtr)
@ -3836,7 +3834,7 @@ int Channel::StopPlayingFileAsMicrophone()
return 0;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_inputFilePlayerPtr->StopPlayingFile() != 0)
{
_engineStatisticsPtr->SetLastError(
@ -3865,7 +3863,7 @@ int Channel::ScaleFileAsMicrophonePlayout(const float scale)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::ScaleFileAsMicrophonePlayout(scale=%5.3f)", scale);
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (!_inputFilePlaying)
{
@ -3927,7 +3925,7 @@ int Channel::StartRecordingPlayout(const char* fileName,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_outputFileRecorderPtr)
@ -4004,7 +4002,7 @@ int Channel::StartRecordingPlayout(OutStream* stream,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_outputFileRecorderPtr)
@ -4055,7 +4053,7 @@ int Channel::StopRecordingPlayout()
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFileRecorderPtr->StopRecording() != 0)
{
@ -4171,7 +4169,7 @@ Channel::EnableSRTPSend(
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::EnableSRTPSend()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_encrypting)
{
@ -4241,7 +4239,7 @@ Channel::DisableSRTPSend()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DisableSRTPSend()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_encrypting)
{
@ -4284,7 +4282,7 @@ Channel::EnableSRTPReceive(
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::EnableSRTPReceive()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_decrypting)
{
@ -4355,7 +4353,7 @@ Channel::DisableSRTPReceive()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DisableSRTPReceive()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_decrypting)
{
@ -4391,7 +4389,7 @@ Channel::RegisterExternalEncryption(Encryption& encryption)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterExternalEncryption()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_encryptionPtr)
{
@ -4415,7 +4413,7 @@ Channel::DeRegisterExternalEncryption()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterExternalEncryption()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_encryptionPtr)
{
@ -4540,7 +4538,7 @@ Channel::RegisterTelephoneEventDetection(
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterTelephoneEventDetection()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_telephoneEventDetectionPtr)
{
@ -4604,7 +4602,7 @@ Channel::DeRegisterTelephoneEventDetection()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::DeRegisterTelephoneEventDetection()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_telephoneEventDetectionPtr)
{
@ -4639,7 +4637,7 @@ Channel::GetTelephoneEventDetectionStatus(
"Channel::GetTelephoneEventDetectionStatus()");
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
enabled = (_telephoneEventDetectionPtr != NULL);
}
@ -4696,7 +4694,7 @@ Channel::RegisterRxVadObserver(VoERxVadCallback &observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterRxVadObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rxVadObserverPtr)
{
@ -4715,7 +4713,7 @@ Channel::DeRegisterRxVadObserver()
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterRxVadObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_rxVadObserverPtr)
{
@ -4986,7 +4984,7 @@ Channel::RegisterRTPObserver(VoERTPObserver& observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::RegisterRTPObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtpObserverPtr)
{
@ -5007,7 +5005,7 @@ Channel::DeRegisterRTPObserver()
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterRTPObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_rtpObserverPtr)
{
@ -5028,7 +5026,7 @@ Channel::RegisterRTCPObserver(VoERTCPObserver& observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterRTCPObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtcpObserverPtr)
{
@ -5049,7 +5047,7 @@ Channel::DeRegisterRTCPObserver()
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::DeRegisterRTCPObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_rtcpObserverPtr)
{
@ -5877,7 +5875,7 @@ Channel::PrepareEncodeAndSend(int mixingFrequency)
if (_inputExternalMedia)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
const bool isStereo = (_audioFrame._audioChannel == 2);
if (_inputExternalMediaCallbackPtr)
{
@ -5973,7 +5971,7 @@ int Channel::RegisterExternalMediaProcessing(
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterExternalMediaProcessing()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (kPlaybackPerChannel == type)
{
@ -6009,7 +6007,7 @@ int Channel::DeRegisterExternalMediaProcessing(ProcessingTypes type)
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::DeRegisterExternalMediaProcessing()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (kPlaybackPerChannel == type)
{
@ -6223,7 +6221,7 @@ Channel::MixOrReplaceAudioWithFile(const int mixingFrequency)
WebRtc_UWord32 fileSamples(0);
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_inputFilePlayerPtr == NULL)
{
@ -6287,7 +6285,7 @@ Channel::MixAudioWithFile(AudioFrame& audioFrame,
WebRtc_UWord32 fileSamples(0);
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFilePlayerPtr == NULL)
{

View File

@ -476,7 +476,7 @@ public:
// A lock is needed because |_sending| is accessed by both
// TransmitMixer::PrepareDemux() and StartSend()/StopSend(), which
// are called by different threads.
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
return _sending;
}
bool Receiving() const
@ -534,7 +534,6 @@ private:
private:
CriticalSectionWrapper& _fileCritSect;
CriticalSectionWrapper& _callbackCritSect;
CriticalSectionWrapper& _transmitCritSect;
WebRtc_UWord32 _instanceId;
WebRtc_Word32 _channelId;

View File

@ -46,7 +46,7 @@ ChannelManagerBase::~ChannelManagerBase()
bool ChannelManagerBase::GetFreeItemId(WebRtc_Word32& itemId)
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
WebRtc_Word32 i(0);
while (i < KMaxNumberOfItems)
{
@ -100,7 +100,7 @@ bool ChannelManagerBase::CreateItem(WebRtc_Word32& itemId)
void ChannelManagerBase::InsertItem(WebRtc_Word32 itemId, void* item)
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
assert(!_items.Find(itemId));
_items.Insert(itemId, item);
}
@ -108,7 +108,7 @@ void ChannelManagerBase::InsertItem(WebRtc_Word32 itemId, void* item)
void*
ChannelManagerBase::RemoveItem(WebRtc_Word32 itemId)
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
WriteLockScoped wlock(*_itemsRWLockPtr);
MapItem* it = _items.Find(itemId);
if (!it)
@ -124,7 +124,7 @@ ChannelManagerBase::RemoveItem(WebRtc_Word32 itemId)
void ChannelManagerBase::DestroyAllItems()
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
MapItem* it = _items.First();
while (it)
{
@ -148,7 +148,7 @@ WebRtc_Word32 ChannelManagerBase::MaxNumOfItems() const
void*
ChannelManagerBase::GetItem(WebRtc_Word32 itemId) const
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
MapItem* it = _items.Find(itemId);
if (!it)
{
@ -161,7 +161,7 @@ ChannelManagerBase::GetItem(WebRtc_Word32 itemId) const
void*
ChannelManagerBase::GetFirstItem(void*& iterator) const
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
MapItem* it = _items.First();
iterator = (void*) it;
if (!it)
@ -174,7 +174,7 @@ ChannelManagerBase::GetFirstItem(void*& iterator) const
void*
ChannelManagerBase::GetNextItem(void*& iterator) const
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
MapItem* it = (MapItem*) iterator;
if (!it)
{
@ -210,7 +210,7 @@ void ChannelManagerBase::GetItemIds(WebRtc_Word32* channelsArray,
void ChannelManagerBase::GetChannels(MapWrapper& channels) const
{
CriticalSectionScoped cs(*_itemsCritSectPtr);
CriticalSectionScoped cs(_itemsCritSectPtr);
if (_items.Size() == 0)
{
return;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -129,7 +129,7 @@ DtmfInband::AddTone(const WebRtc_UWord8 eventCode,
WebRtc_Word32 lengthMs,
WebRtc_Word32 attenuationDb)
{
CriticalSectionScoped lock(_critSect);
CriticalSectionScoped lock(&_critSect);
if (attenuationDb > 36 || eventCode > 15)
{
@ -158,7 +158,7 @@ DtmfInband::AddTone(const WebRtc_UWord8 eventCode,
int
DtmfInband::ResetTone()
{
CriticalSectionScoped lock(_critSect);
CriticalSectionScoped lock(&_critSect);
ReInit();
@ -173,7 +173,7 @@ int
DtmfInband::StartTone(const WebRtc_UWord8 eventCode,
WebRtc_Word32 attenuationDb)
{
CriticalSectionScoped lock(_critSect);
CriticalSectionScoped lock(&_critSect);
if (attenuationDb > 36 || eventCode > 15)
{
@ -199,7 +199,7 @@ DtmfInband::StartTone(const WebRtc_UWord8 eventCode,
int
DtmfInband::StopTone()
{
CriticalSectionScoped lock(_critSect);
CriticalSectionScoped lock(&_critSect);
if (!_playing)
{
@ -221,7 +221,7 @@ DtmfInband::ReInit()
bool
DtmfInband::IsAddingTone()
{
CriticalSectionScoped lock(_critSect);
CriticalSectionScoped lock(&_critSect);
return (_remainingSamples > 0 || _playing);
}
@ -229,7 +229,7 @@ int
DtmfInband::Get10msTone(WebRtc_Word16 output[320],
WebRtc_UWord16& outputSizeInSamples)
{
CriticalSectionScoped lock(_critSect);
CriticalSectionScoped lock(&_critSect);
if (DtmfFix_generate(output,
_eventCode,
_attenuationDb,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -33,7 +33,7 @@ DtmfInbandQueue::AddDtmf(WebRtc_UWord8 key,
WebRtc_UWord16 len,
WebRtc_UWord8 level)
{
CriticalSectionScoped lock(_DtmfCritsect);
CriticalSectionScoped lock(&_DtmfCritsect);
if (_nextEmptyIndex >= kDtmfInbandMax)
{
@ -52,7 +52,7 @@ DtmfInbandQueue::AddDtmf(WebRtc_UWord8 key,
WebRtc_Word8
DtmfInbandQueue::NextDtmf(WebRtc_UWord16* len, WebRtc_UWord8* level)
{
CriticalSectionScoped lock(_DtmfCritsect);
CriticalSectionScoped lock(&_DtmfCritsect);
if(!PendingDtmf())
{

View File

@ -30,7 +30,7 @@ MonitorModule::~MonitorModule()
WebRtc_Word32
MonitorModule::RegisterObserver(MonitorObserver& observer)
{
CriticalSectionScoped lock(_callbackCritSect);
CriticalSectionScoped lock(&_callbackCritSect);
if (_observerPtr)
{
return -1;
@ -42,7 +42,7 @@ MonitorModule::RegisterObserver(MonitorObserver& observer)
WebRtc_Word32
MonitorModule::DeRegisterObserver()
{
CriticalSectionScoped lock(_callbackCritSect);
CriticalSectionScoped lock(&_callbackCritSect);
if (!_observerPtr)
{
return 0;
@ -80,7 +80,7 @@ MonitorModule::Process()
_lastProcessTime = GET_TIME_IN_MS();
if (_observerPtr)
{
CriticalSectionScoped lock(_callbackCritSect);
CriticalSectionScoped lock(&_callbackCritSect);
_observerPtr->OnPeriodicProcess();
}
return 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -94,7 +94,7 @@ void OutputMixer::RecordFileEnded(const WebRtc_Word32 id)
"OutputMixer::RecordFileEnded(id=%d)", id);
assert(id == _instanceId);
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
_outputFileRecording = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::RecordFileEnded() =>"
@ -165,7 +165,7 @@ OutputMixer::~OutputMixer()
DeRegisterExternalMediaProcessing();
}
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFileRecorderPtr)
{
_outputFileRecorderPtr->RegisterModuleFileCallback(NULL);
@ -207,7 +207,7 @@ int OutputMixer::RegisterExternalMediaProcessing(
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::RegisterExternalMediaProcessing()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
_externalMediaCallbackPtr = &proccess_object;
_externalMedia = true;
@ -219,7 +219,7 @@ int OutputMixer::DeRegisterExternalMediaProcessing()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::DeRegisterExternalMediaProcessing()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
_externalMedia = false;
_externalMediaCallbackPtr = NULL;
@ -365,7 +365,7 @@ int OutputMixer::StartRecordingPlayout(const char* fileName,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_outputFileRecorderPtr)
@ -445,7 +445,7 @@ int OutputMixer::StartRecordingPlayout(OutStream* stream,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
// Destroy the old instance
if (_outputFileRecorderPtr)
@ -496,7 +496,7 @@ int OutputMixer::StopRecordingPlayout()
return -1;
}
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFileRecorderPtr->StopRecording() != 0)
{
@ -526,7 +526,7 @@ OutputMixer::GetMixedAudio(const WebRtc_Word32 desiredFreqHz,
// --- Record playout if enabled
{
CriticalSectionScoped cs(_fileCritSect);
CriticalSectionScoped cs(&_fileCritSect);
if (_outputFileRecording)
{
assert(audioFrame._audioChannel == 1);
@ -632,7 +632,7 @@ OutputMixer::DoOperationsOnCombinedSignal()
if (_externalMedia)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
const bool isStereo = (_audioFrame._audioChannel == 2);
if (_externalMediaCallbackPtr)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -29,7 +29,7 @@ RefCount::~RefCount()
RefCount&
RefCount::operator++(int)
{
CriticalSectionScoped lock(_crit);
CriticalSectionScoped lock(&_crit);
_count++;
return *this;
}
@ -37,7 +37,7 @@ RefCount::operator++(int)
RefCount&
RefCount::operator--(int)
{
CriticalSectionScoped lock(_crit);
CriticalSectionScoped lock(&_crit);
_count--;
return *this;
}
@ -45,7 +45,7 @@ RefCount::operator--(int)
void
RefCount::Reset()
{
CriticalSectionScoped lock(_crit);
CriticalSectionScoped lock(&_crit);
_count = 0;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -56,7 +56,7 @@ bool Statistics::Initialized() const
WebRtc_Word32 Statistics::SetLastError(const WebRtc_Word32 error) const
{
CriticalSectionScoped cs(*_critPtr);
CriticalSectionScoped cs(_critPtr);
_lastError = error;
return 0;
}
@ -64,7 +64,7 @@ WebRtc_Word32 Statistics::SetLastError(const WebRtc_Word32 error) const
WebRtc_Word32 Statistics::SetLastError(const WebRtc_Word32 error,
const TraceLevel level) const
{
CriticalSectionScoped cs(*_critPtr);
CriticalSectionScoped cs(_critPtr);
_lastError = error;
WEBRTC_TRACE(level, kTraceVoice, VoEId(_instanceId,-1),
"error code is set to %d",
@ -76,7 +76,7 @@ WebRtc_Word32 Statistics::SetLastError(
const WebRtc_Word32 error,
const TraceLevel level, const char* msg) const
{
CriticalSectionScoped cs(*_critPtr);
CriticalSectionScoped cs(_critPtr);
char traceMessage[KTraceMaxMessageSize];
assert(strlen(msg) < KTraceMaxMessageSize);
_lastError = error;
@ -88,7 +88,7 @@ WebRtc_Word32 Statistics::SetLastError(
WebRtc_Word32 Statistics::LastError() const
{
CriticalSectionScoped cs(*_critPtr);
CriticalSectionScoped cs(_critPtr);
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
"LastError() => %d", _lastError);
return _lastError;

View File

@ -36,7 +36,7 @@ TransmitMixer::OnPeriodicProcess()
#if defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
if (_typingNoiseWarning > 0)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserverPtr)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
@ -51,7 +51,7 @@ TransmitMixer::OnPeriodicProcess()
if (_saturationWarning > 0)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserverPtr)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
@ -64,7 +64,7 @@ TransmitMixer::OnPeriodicProcess()
if (_noiseWarning > 0)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserverPtr)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
@ -104,7 +104,7 @@ void TransmitMixer::PlayFileEnded(const WebRtc_Word32 id)
assert(id == _filePlayerId);
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
_filePlaying = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, -1),
@ -120,14 +120,14 @@ TransmitMixer::RecordFileEnded(const WebRtc_Word32 id)
if (id == _fileRecorderId)
{
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
_fileRecording = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, -1),
"TransmitMixer::RecordFileEnded() => fileRecorder module"
"is shutdown");
} else if (id == _fileCallRecorderId)
{
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
_fileCallRecording = false;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, -1),
"TransmitMixer::RecordFileEnded() => fileCallRecorder"
@ -216,7 +216,7 @@ TransmitMixer::~TransmitMixer()
DeRegisterExternalMediaProcessing();
}
{
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (_fileRecorderPtr)
{
_fileRecorderPtr->RegisterModuleFileCallback(NULL);
@ -273,7 +273,7 @@ TransmitMixer::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
"TransmitMixer::RegisterVoiceEngineObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserverPtr)
{
@ -394,7 +394,7 @@ TransmitMixer::PrepareDemux(const WebRtc_Word8* audioSamples,
if (_externalMedia)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
const bool isStereo = (_audioFrame._audioChannel == 2);
if (_externalMediaCallbackPtr)
{
@ -514,7 +514,7 @@ int TransmitMixer::StartPlayingFileAsMicrophone(const char* fileName,
return 0;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
// Destroy the old instance
if (_filePlayerPtr)
@ -591,7 +591,7 @@ int TransmitMixer::StartPlayingFileAsMicrophone(InStream* stream,
return 0;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
// Destroy the old instance
if (_filePlayerPtr)
@ -651,7 +651,7 @@ int TransmitMixer::StopPlayingFileAsMicrophone()
return 0;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (_filePlayerPtr->StopPlayingFile() != 0)
{
@ -682,7 +682,7 @@ int TransmitMixer::ScaleFileAsMicrophonePlayout(const float scale)
"TransmitMixer::ScaleFileAsMicrophonePlayout(scale=%5.3f)",
scale);
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (!_filePlaying)
{
@ -744,7 +744,7 @@ int TransmitMixer::StartRecordingMicrophone(const char* fileName,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
// Destroy the old instance
if (_fileRecorderPtr)
@ -822,7 +822,7 @@ int TransmitMixer::StartRecordingMicrophone(OutStream* stream,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
// Destroy the old instance
if (_fileRecorderPtr)
@ -874,7 +874,7 @@ int TransmitMixer::StopRecordingMicrophone()
return -1;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (_fileRecorderPtr->StopRecording() != 0)
{
@ -929,7 +929,7 @@ int TransmitMixer::StartRecordingCall(const char* fileName,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
// Destroy the old instance
if (_fileCallRecorderPtr)
@ -1007,7 +1007,7 @@ int TransmitMixer::StartRecordingCall(OutStream* stream,
format = kFileFormatCompressedFile;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
// Destroy the old instance
if (_fileCallRecorderPtr)
@ -1058,7 +1058,7 @@ int TransmitMixer::StopRecordingCall()
return -1;
}
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (_fileCallRecorderPtr->StopRecording() != 0)
{
@ -1088,7 +1088,7 @@ int TransmitMixer::RegisterExternalMediaProcessing(
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
"TransmitMixer::RegisterExternalMediaProcessing()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
_externalMediaCallbackPtr = &proccess_object;
_externalMedia = true;
@ -1100,7 +1100,7 @@ int TransmitMixer::DeRegisterExternalMediaProcessing()
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, -1),
"TransmitMixer::DeRegisterExternalMediaProcessing()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
_externalMedia = false;
_externalMediaCallbackPtr = NULL;
@ -1195,7 +1195,7 @@ TransmitMixer::GenerateAudioFrame(const WebRtc_Word16 audioSamples[],
WebRtc_Word32 TransmitMixer::RecordAudioToFile(
const WebRtc_UWord32 mixingFrequency)
{
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (_fileRecorderPtr == NULL)
{
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
@ -1223,7 +1223,7 @@ WebRtc_Word32 TransmitMixer::MixOrReplaceAudioWithFile(
WebRtc_UWord32 fileSamples(0);
{
CriticalSectionScoped cs(_critSect);
CriticalSectionScoped cs(&_critSect);
if (_filePlayerPtr == NULL)
{
WEBRTC_TRACE(kTraceWarning, kTraceVoice,

View File

@ -84,7 +84,7 @@ int VoEBaseImpl::Release()
void VoEBaseImpl::OnErrorIsReported(const ErrorCode error)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserver)
{
if (_voiceEngineObserverPtr)
@ -112,7 +112,7 @@ void VoEBaseImpl::OnErrorIsReported(const ErrorCode error)
void VoEBaseImpl::OnWarningIsReported(const WarningCode warning)
{
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserver)
{
if (_voiceEngineObserverPtr)
@ -289,7 +289,7 @@ int VoEBaseImpl::RegisterVoiceEngineObserver(VoiceEngineObserver& observer)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"RegisterVoiceEngineObserver(observer=0x%d)", &observer);
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (_voiceEngineObserverPtr)
{
_engineStatistics.SetLastError(VE_INVALID_OPERATION, kTraceError,
@ -319,7 +319,7 @@ int VoEBaseImpl::DeRegisterVoiceEngineObserver()
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"DeRegisterVoiceEngineObserver()");
CriticalSectionScoped cs(_callbackCritSect);
CriticalSectionScoped cs(&_callbackCritSect);
if (!_voiceEngineObserverPtr)
{
_engineStatistics.SetLastError(VE_INVALID_OPERATION, kTraceError,
@ -347,7 +347,7 @@ int VoEBaseImpl::Init(AudioDeviceModule* external_adm)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"Init(external_adm=0x%p)", external_adm);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (_engineStatistics.Initialized())
{
@ -657,7 +657,7 @@ int VoEBaseImpl::Terminate()
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"Terminate()");
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
return TerminateInternal();
}
@ -675,7 +675,7 @@ int VoEBaseImpl::CreateChannel()
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"CreateChannel()");
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
@ -741,7 +741,7 @@ int VoEBaseImpl::DeleteChannel(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"DeleteChannel(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
@ -796,7 +796,7 @@ int VoEBaseImpl::SetLocalReceiver(int channel, int port, int RTCPport,
// SetSendDestination and StartSend without having called SetLocalReceiver
// first. The sockets are then created at the first packet transmission.
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (ipAddr == NULL && multiCastAddr == NULL)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
@ -924,7 +924,7 @@ int VoEBaseImpl::SetSendDestination(int channel, int port, const char* ipaddr,
"SetSendDestination(channel=%d, port=%d, ipaddr=%s,"
"sourcePort=%d, RTCPport=%d)",
channel, port, ipaddr, sourcePort, RTCPport);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
#ifndef WEBRTC_EXTERNAL_TRANSPORT
if (!_engineStatistics.Initialized())
{
@ -1050,7 +1050,7 @@ int VoEBaseImpl::StartReceive(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"StartReceive(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);
@ -1072,7 +1072,7 @@ int VoEBaseImpl::StopReceive(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"StopListen(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);
@ -1094,7 +1094,7 @@ int VoEBaseImpl::StartPlayout(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"StartPlayout(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);
@ -1128,7 +1128,7 @@ int VoEBaseImpl::StopPlayout(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"StopPlayout(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);
@ -1156,7 +1156,7 @@ int VoEBaseImpl::StartSend(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"StartSend(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);
@ -1198,7 +1198,7 @@ int VoEBaseImpl::StopSend(int channel)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"StopSend(channel=%d)", channel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
if (!_engineStatistics.Initialized())
{
_engineStatistics.SetLastError(VE_NOT_INITED, kTraceError);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -395,7 +395,7 @@ int VoEDtmfImpl::SetDtmfFeedbackStatus(bool enable, bool directFeedback)
"SetDtmfFeedbackStatus(enable=%d, directFeeback=%d)",
(int)enable, (int)directFeedback);
CriticalSectionScoped sc(*_apiCritPtr);
CriticalSectionScoped sc(_apiCritPtr);
_dtmfFeedback = enable;
_dtmfDirectFeedback = directFeedback;
@ -408,7 +408,7 @@ int VoEDtmfImpl::GetDtmfFeedbackStatus(bool& enabled, bool& directFeedback)
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1),
"GetDtmfFeedbackStatus()");
CriticalSectionScoped sc(*_apiCritPtr);
CriticalSectionScoped sc(_apiCritPtr);
enabled = _dtmfFeedback;
directFeedback = _dtmfDirectFeedback;

View File

@ -341,7 +341,7 @@ int VoEHardwareImpl::SetRecordingDevice(int index,
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"SetRecordingDevice(index=%d, recordingChannel=%d)",
index, (int) recordingChannel);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
ANDROID_NOT_SUPPORTED(_engineStatistics);
IPHONE_NOT_SUPPORTED();
@ -478,7 +478,7 @@ int VoEHardwareImpl::SetPlayoutDevice(int index)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId, -1),
"SetPlayoutDevice(index=%d)", index);
CriticalSectionScoped cs(*_apiCritPtr);
CriticalSectionScoped cs(_apiCritPtr);
ANDROID_NOT_SUPPORTED(_engineStatistics);
IPHONE_NOT_SUPPORTED();