diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc index 94e528d379..359e131637 100644 --- a/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc +++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc @@ -230,7 +230,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::TimeUntilNextProcess() WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "TimeUntilNextProcess()"); WebRtc_Word32 timeUntilNextProcess = 0; - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); if(_timeScheduler.TimeToNextUpdate(timeUntilNextProcess) != 0) { WEBRTC_TRACE(kTraceError, kTraceAudioMixerServer, _id, @@ -247,7 +247,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() WebRtc_UWord32 remainingParticipantsAllowedToMix = kMaximumAmountOfMixedParticipants; { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); assert(_processCalls == 0); _processCalls++; @@ -260,7 +260,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() ListWrapper additionalFramesList; MapWrapper mixedParticipantsMap; { - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); WebRtc_Word32 lowFreq = GetLowestMixingFrequency(); // SILK can run in 12 kHz and 24 kHz. These frequencies are not @@ -276,7 +276,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() } if(lowFreq <= 0) { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); _processCalls--; return 0; } else { @@ -303,7 +303,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() default: assert(false); - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); _processCalls--; return -1; } @@ -348,7 +348,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() // TODO(henrike): it might be better to decide the number of channels // with an API instead of dynamically. - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); if (!SetNumLimiterChannels(numberOfChannels)) retval = -1; @@ -391,7 +391,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() } { - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); if(_mixReceiver != NULL) { const AudioFrame** dummy = NULL; @@ -424,7 +424,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::Process() ClearAudioFrameList(rampOutList); ClearAudioFrameList(additionalFramesList); { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); _processCalls--; } return retval; @@ -435,7 +435,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::RegisterMixedStreamCallback( { WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "RegisterMixedStreamCallback(mixReceiver)"); - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); if(_mixReceiver != NULL) { return -1; @@ -448,7 +448,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::UnRegisterMixedStreamCallback() { WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "UnRegisterMixedStreamCallback()"); - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); if(_mixReceiver == NULL) { return -1; @@ -460,7 +460,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::UnRegisterMixedStreamCallback() WebRtc_Word32 AudioConferenceMixerImpl::SetOutputFrequency( const Frequency frequency) { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); const int error = _limiter->set_sample_rate_hz(frequency); if(error != _limiter->kNoError) { @@ -478,7 +478,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::SetOutputFrequency( AudioConferenceMixer::Frequency AudioConferenceMixerImpl::OutputFrequency() const { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); return _outputFrequency; } @@ -520,7 +520,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::RegisterMixerStatusCallback( return -1; } { - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); if(_mixerStatusCallback != NULL) { WEBRTC_TRACE(kTraceWarning, kTraceAudioMixerServer, _id, @@ -530,7 +530,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::RegisterMixerStatusCallback( _mixerStatusCallback = &mixerStatusCallback; } { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); _amountOf10MsBetweenCallbacks = amountOf10MsBetweenCallbacks; _amountOf10MsUntilNextCallback = 0; _mixerStatusCb = true; @@ -543,7 +543,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::UnRegisterMixerStatusCallback() WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "UnRegisterMixerStatusCallback()"); { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); if(!_mixerStatusCb) { WEBRTC_TRACE(kTraceWarning, kTraceAudioMixerServer, _id, @@ -553,7 +553,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::UnRegisterMixerStatusCallback() _mixerStatusCb = false; } { - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); _mixerStatusCallback = NULL; } return 0; @@ -574,7 +574,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::SetMixabilityStatus( } WebRtc_UWord32 amountOfMixableParticipants; { - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); const bool isMixed = IsParticipantInList(participant,_participantList); // API must be called with a new state. @@ -607,7 +607,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::SetMixabilityStatus( // A MixerParticipant was added or removed. Make sure the scratch // buffer is updated if necessary. // Note: The scratch buffer may only be updated in Process(). - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); _amountOfMixableParticipants = amountOfMixableParticipants; return 0; } @@ -618,7 +618,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::MixabilityStatus( { WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "MixabilityStatus(participant,mixable)"); - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); mixable = IsParticipantInList(participant, _participantList); return 0; } @@ -628,7 +628,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::AmountOfMixables( { WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "AmountOfMixables(amountOfMixableParticipants)"); - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit.get()); amountOfMixableParticipants = _amountOfMixableParticipants; return 0; } @@ -639,7 +639,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::SetAnonymousMixabilityStatus( WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "SetAnonymousMixabilityStatus(participant,anonymous:%s)", anonymous ? "true" : "false"); - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); if(IsParticipantInList(participant, _additionalParticipantList)) { if(anonymous) @@ -681,7 +681,7 @@ WebRtc_Word32 AudioConferenceMixerImpl::AnonymousMixabilityStatus( { WEBRTC_TRACE(kTraceModuleCall, kTraceAudioMixerServer, _id, "AnonymousMixabilityStatus(participant,mixable)"); - CriticalSectionScoped cs(*_cbCrit); + CriticalSectionScoped cs(_cbCrit.get()); mixable = IsParticipantInList(participant, _additionalParticipantList); return 0; diff --git a/src/modules/audio_conference_mixer/source/memory_pool_posix.h b/src/modules/audio_conference_mixer/source/memory_pool_posix.h index 56eabbdafd..45f800b297 100644 --- a/src/modules/audio_conference_mixer/source/memory_pool_posix.h +++ b/src/modules/audio_conference_mixer/source/memory_pool_posix.h @@ -70,7 +70,7 @@ MemoryPoolImpl::~MemoryPoolImpl() template WebRtc_Word32 MemoryPoolImpl::PopMemory(MemoryType*& memory) { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit); if(_terminate) { memory = NULL; @@ -101,7 +101,7 @@ WebRtc_Word32 MemoryPoolImpl::PushMemory(MemoryType*& memory) { return -1; } - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit); _outstandingMemory--; if(_memoryPool.GetSize() > (_initialPoolSize << 1)) { @@ -119,14 +119,14 @@ WebRtc_Word32 MemoryPoolImpl::PushMemory(MemoryType*& memory) template bool MemoryPoolImpl::Initialize() { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit); return CreateMemory(_initialPoolSize) == 0; } template WebRtc_Word32 MemoryPoolImpl::Terminate() { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit); assert(_createdMemory == _outstandingMemory + _memoryPool.GetSize()); _terminate = true; diff --git a/src/modules/audio_conference_mixer/source/time_scheduler.cc b/src/modules/audio_conference_mixer/source/time_scheduler.cc index ccfe719f03..183005e370 100644 --- a/src/modules/audio_conference_mixer/source/time_scheduler.cc +++ b/src/modules/audio_conference_mixer/source/time_scheduler.cc @@ -29,7 +29,7 @@ TimeScheduler::~TimeScheduler() WebRtc_Word32 TimeScheduler::UpdateScheduler() { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit); if(!_isStarted) { _isStarted = true; @@ -79,7 +79,7 @@ WebRtc_Word32 TimeScheduler::UpdateScheduler() WebRtc_Word32 TimeScheduler::TimeToNextUpdate( WebRtc_Word32& updateTimeInMS) const { - CriticalSectionScoped cs(*_crit); + CriticalSectionScoped cs(_crit); // Missed periods means that the next UpdateScheduler() should happen // immediately. if(_missedPeriods > 0)