Removed usage of the deprecated critical section constructor in rtp_rtcp.
Review URL: http://webrtc-codereview.appspot.com/315004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1173 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
2a61e15bff
commit
65573f2922
@ -19,7 +19,7 @@ namespace webrtc {
|
||||
|
||||
BandwidthManagement::BandwidthManagement(const WebRtc_Word32 id) :
|
||||
_id(id),
|
||||
_critsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_critsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_lastPacketLossExtendedHighSeqNum(0),
|
||||
_lastReportAllLost(false),
|
||||
_lastLoss(0),
|
||||
@ -39,7 +39,7 @@ BandwidthManagement::BandwidthManagement(const WebRtc_Word32 id) :
|
||||
|
||||
BandwidthManagement::~BandwidthManagement()
|
||||
{
|
||||
delete &_critsect;
|
||||
delete _critsect;
|
||||
}
|
||||
|
||||
WebRtc_Word32
|
||||
|
@ -64,7 +64,7 @@ private:
|
||||
|
||||
WebRtc_Word32 _id;
|
||||
|
||||
CriticalSectionWrapper& _critsect;
|
||||
CriticalSectionWrapper* _critsect;
|
||||
|
||||
// incoming filters
|
||||
WebRtc_UWord32 _lastPacketLossExtendedHighSeqNum;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
DTMFqueue::DTMFqueue():
|
||||
_DTMFCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_DTMFCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_nextEmptyIndex(0)
|
||||
{
|
||||
memset(_DTMFKey,0, sizeof(_DTMFKey));
|
||||
@ -24,7 +24,7 @@ DTMFqueue::DTMFqueue():
|
||||
|
||||
DTMFqueue::~DTMFqueue()
|
||||
{
|
||||
delete &_DTMFCritsect;
|
||||
delete _DTMFCritsect;
|
||||
}
|
||||
|
||||
WebRtc_Word32
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
void ResetDTMF();
|
||||
|
||||
private:
|
||||
CriticalSectionWrapper& _DTMFCritsect;
|
||||
CriticalSectionWrapper* _DTMFCritsect;
|
||||
WebRtc_UWord8 _nextEmptyIndex;
|
||||
WebRtc_UWord8 _DTMFKey[DTMF_OUTBAND_MAX];
|
||||
WebRtc_UWord16 _DTMFLen[DTMF_OUTBAND_MAX];
|
||||
|
@ -35,10 +35,11 @@ RTCPReceiver::RTCPReceiver(const WebRtc_Word32 id,
|
||||
_method(kRtcpOff),
|
||||
_lastReceived(0),
|
||||
_rtpRtcp(*owner),
|
||||
_criticalSectionFeedbacks(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionFeedbacks(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_cbRtcpFeedback(NULL),
|
||||
_cbVideoFeedback(NULL),
|
||||
_criticalSectionRTCPReceiver(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionRTCPReceiver(
|
||||
CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_SSRC(0),
|
||||
_remoteSSRC(0),
|
||||
_remoteSenderInfo(),
|
||||
@ -53,8 +54,8 @@ RTCPReceiver::RTCPReceiver(const WebRtc_Word32 id,
|
||||
|
||||
RTCPReceiver::~RTCPReceiver()
|
||||
{
|
||||
delete &_criticalSectionRTCPReceiver;
|
||||
delete &_criticalSectionFeedbacks;
|
||||
delete _criticalSectionRTCPReceiver;
|
||||
delete _criticalSectionFeedbacks;
|
||||
|
||||
bool loop = true;
|
||||
do
|
||||
@ -481,13 +482,13 @@ RTCPReceiver::HandleReportBlock(const RTCPUtility::RTCPPacket& rtcpPacket,
|
||||
}
|
||||
}
|
||||
|
||||
_criticalSectionRTCPReceiver.Leave();
|
||||
_criticalSectionRTCPReceiver->Leave();
|
||||
// to avoid problem with accuireing _criticalSectionRTCPSender while holding _criticalSectionRTCPReceiver
|
||||
|
||||
WebRtc_UWord32 sendTimeMS =
|
||||
_rtpRtcp.SendTimeOfSendReport(rtcpPacket.ReportBlockItem.LastSR);
|
||||
|
||||
_criticalSectionRTCPReceiver.Enter();
|
||||
_criticalSectionRTCPReceiver->Enter();
|
||||
|
||||
// ReportBlockItem.SSRC is who it's to
|
||||
// we store all incoming reports, used in conference relay
|
||||
|
@ -187,11 +187,11 @@ private:
|
||||
WebRtc_UWord32 _lastReceived;
|
||||
ModuleRtpRtcpImpl& _rtpRtcp;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionFeedbacks;
|
||||
CriticalSectionWrapper* _criticalSectionFeedbacks;
|
||||
RtcpFeedback* _cbRtcpFeedback;
|
||||
RtpVideoFeedback* _cbVideoFeedback;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionRTCPReceiver;
|
||||
CriticalSectionWrapper* _criticalSectionRTCPReceiver;
|
||||
WebRtc_UWord32 _SSRC;
|
||||
WebRtc_UWord32 _remoteSSRC;
|
||||
|
||||
|
@ -31,10 +31,10 @@ RTCPSender::RTCPSender(const WebRtc_Word32 id,
|
||||
_clock(*clock),
|
||||
_method(kRtcpOff),
|
||||
_rtpRtcp(*owner),
|
||||
_criticalSectionTransport(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionTransport(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_cbTransport(NULL),
|
||||
|
||||
_criticalSectionRTCPSender(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionRTCPSender(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_usingNack(false),
|
||||
_sending(false),
|
||||
_sendTMMBN(false),
|
||||
@ -112,8 +112,8 @@ RTCPSender::~RTCPSender()
|
||||
_csrcCNAMEs.Erase(item);
|
||||
item = _csrcCNAMEs.First();
|
||||
}
|
||||
delete &_criticalSectionTransport;
|
||||
delete &_criticalSectionRTCPSender;
|
||||
delete _criticalSectionTransport;
|
||||
delete _criticalSectionRTCPSender;
|
||||
|
||||
WEBRTC_TRACE(kTraceMemory, kTraceRtpRtcp, _id, "%s deleted", __FUNCTION__);
|
||||
}
|
||||
|
@ -178,10 +178,10 @@ private:
|
||||
|
||||
ModuleRtpRtcpImpl& _rtpRtcp;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionTransport;
|
||||
CriticalSectionWrapper* _criticalSectionTransport;
|
||||
Transport* _cbTransport;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionRTCPSender;
|
||||
CriticalSectionWrapper* _criticalSectionRTCPSender;
|
||||
bool _usingNack;
|
||||
bool _sending;
|
||||
bool _sendTMMBN;
|
||||
|
@ -31,11 +31,12 @@ RTPReceiver::RTPReceiver(const WebRtc_Word32 id,
|
||||
_id(id),
|
||||
_audio(audio),
|
||||
_rtpRtcp(*owner),
|
||||
_criticalSectionCbs(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionCbs(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_cbRtpFeedback(NULL),
|
||||
_cbRtpData(NULL),
|
||||
|
||||
_criticalSectionRTPReceiver(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionRTPReceiver(
|
||||
CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_lastReceiveTime(0),
|
||||
_lastReceivedPayloadLength(0),
|
||||
_lastReceivedPayloadType(-1),
|
||||
@ -101,8 +102,8 @@ RTPReceiver::~RTPReceiver()
|
||||
_cbRtpFeedback->OnIncomingCSRCChanged(_id,_currentRemoteCSRC[i], false);
|
||||
}
|
||||
}
|
||||
delete &_criticalSectionCbs;
|
||||
delete &_criticalSectionRTPReceiver;
|
||||
delete _criticalSectionCbs;
|
||||
delete _criticalSectionRTPReceiver;
|
||||
|
||||
// empty map
|
||||
bool loop = true;
|
||||
|
@ -174,11 +174,11 @@ private:
|
||||
const bool _audio;
|
||||
ModuleRtpRtcpImpl& _rtpRtcp;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionCbs;
|
||||
CriticalSectionWrapper* _criticalSectionCbs;
|
||||
RtpFeedback* _cbRtpFeedback;
|
||||
RtpData* _cbRtpData;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionRTPReceiver;
|
||||
CriticalSectionWrapper* _criticalSectionRTPReceiver;
|
||||
mutable WebRtc_UWord32 _lastReceiveTime;
|
||||
WebRtc_UWord16 _lastReceivedPayloadLength;
|
||||
WebRtc_Word8 _lastReceivedPayloadType;
|
||||
|
@ -31,14 +31,14 @@ RTPReceiverAudio::RTPReceiverAudio(const WebRtc_Word32 id):
|
||||
_cngPayloadType(-1),
|
||||
_G722PayloadType(-1),
|
||||
_lastReceivedG722(false),
|
||||
_criticalSectionFeedback(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionFeedback(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_cbAudioFeedback(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
RTPReceiverAudio::~RTPReceiverAudio()
|
||||
{
|
||||
delete &_criticalSectionFeedback;
|
||||
delete _criticalSectionFeedback;
|
||||
}
|
||||
|
||||
WebRtc_Word32
|
||||
|
@ -89,7 +89,7 @@ private:
|
||||
WebRtc_Word8 _G722PayloadType;
|
||||
bool _lastReceivedG722;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionFeedback;
|
||||
CriticalSectionWrapper* _criticalSectionFeedback;
|
||||
RtpAudioFeedback* _cbAudioFeedback;
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
@ -28,10 +28,10 @@ RTPReceiverVideo::RTPReceiverVideo(const WebRtc_Word32 id,
|
||||
ModuleRtpRtcpImpl* owner):
|
||||
_id(id),
|
||||
_rtpRtcp(*owner),
|
||||
_criticalSectionFeedback(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionFeedback(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_cbVideoFeedback(NULL),
|
||||
_criticalSectionReceiverVideo(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
|
||||
_criticalSectionReceiverVideo(
|
||||
CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_completeFrame(false),
|
||||
_packetStartTimeMs(0),
|
||||
_receivedBW(),
|
||||
@ -49,8 +49,8 @@ RTPReceiverVideo::RTPReceiverVideo(const WebRtc_Word32 id,
|
||||
|
||||
RTPReceiverVideo::~RTPReceiverVideo()
|
||||
{
|
||||
delete &_criticalSectionFeedback;
|
||||
delete &_criticalSectionReceiverVideo;
|
||||
delete _criticalSectionFeedback;
|
||||
delete _criticalSectionReceiverVideo;
|
||||
delete _receiveFEC;
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ RTPReceiverVideo::ParseVideoCodecSpecific(WebRtcRTPHeader* rtpHeader,
|
||||
{
|
||||
WebRtc_Word32 retVal = 0;
|
||||
|
||||
_criticalSectionReceiverVideo.Enter();
|
||||
_criticalSectionReceiverVideo->Enter();
|
||||
|
||||
_videoBitRate.Update(payloadDataLength, nowMS);
|
||||
|
||||
@ -242,7 +242,7 @@ RTPReceiverVideo::ParseVideoCodecSpecific(WebRtcRTPHeader* rtpHeader,
|
||||
{
|
||||
if(_receiveFEC == NULL)
|
||||
{
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
return -1;
|
||||
}
|
||||
if (rtpHeader->header.timestamp != TimeStamp())
|
||||
@ -269,7 +269,7 @@ RTPReceiverVideo::ParseVideoCodecSpecific(WebRtcRTPHeader* rtpHeader,
|
||||
_receiveFEC->AddReceivedFECInfo(rtpHeader,incomingRtpPacket, FECpacket);
|
||||
}
|
||||
}
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
if(retVal == 0 && FECpacket )
|
||||
{
|
||||
@ -296,18 +296,18 @@ RTPReceiverVideo::ParseVideoCodecSpecific(WebRtcRTPHeader* rtpHeader,
|
||||
|
||||
// Update the remote rate control object and update the overuse
|
||||
// detector with the current rate control region.
|
||||
_criticalSectionReceiverVideo.Enter();
|
||||
_criticalSectionReceiverVideo->Enter();
|
||||
const RateControlInput input(_overUseDetector.State(),
|
||||
_videoBitRate.BitRate(nowMS),
|
||||
_overUseDetector.NoiseVar());
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
// Call the callback outside critical section
|
||||
const RateControlRegion region = _rtpRtcp.OnOverUseStateUpdate(input);
|
||||
|
||||
_criticalSectionReceiverVideo.Enter();
|
||||
_criticalSectionReceiverVideo->Enter();
|
||||
_overUseDetector.SetRateControlRegion(region);
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
return retVal;
|
||||
}
|
||||
@ -356,7 +356,7 @@ RTPReceiverVideo::ReceiveRecoveredPacketCallback(WebRtcRTPHeader* rtpHeader,
|
||||
const WebRtc_UWord8* payloadData,
|
||||
const WebRtc_UWord16 payloadDataLength)
|
||||
{
|
||||
_criticalSectionReceiverVideo.Enter();
|
||||
_criticalSectionReceiverVideo->Enter();
|
||||
|
||||
_currentFecFrameDecoded = true;
|
||||
|
||||
@ -450,7 +450,7 @@ RTPReceiverVideo::ParseVideoCodecSpecificSwitch(WebRtcRTPHeader* rtpHeader,
|
||||
retVal = ReceiveMPEG4Codec(rtpHeader,payloadData, payloadDataLength);
|
||||
break;
|
||||
default:
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
assert(((void)"ParseCodecSpecific videoType can not be unknown here!", false));
|
||||
return -1;
|
||||
}
|
||||
@ -470,7 +470,7 @@ RTPReceiverVideo::ReceiveH263Codec(WebRtcRTPHeader* rtpHeader,
|
||||
const bool success = rtpPayloadParser.Parse(parsedPacket);
|
||||
|
||||
// from here down we only work on local data
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@ -498,17 +498,17 @@ RTPReceiverVideo::ReceiveH2631998Codec(WebRtcRTPHeader* rtpHeader,
|
||||
const bool success = rtpPayloadParser.Parse(parsedPacket);
|
||||
if (!success)
|
||||
{
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
return -1;
|
||||
}
|
||||
if (IP_PACKET_SIZE < parsedPacket.info.H263.dataLength +
|
||||
(parsedPacket.info.H263.insert2byteStartCode ? 2 : 0))
|
||||
{
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
return -1;
|
||||
}
|
||||
// from here down we only work on local data
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
return ReceiveH263CodecCommon(parsedPacket, rtpHeader);
|
||||
}
|
||||
@ -590,11 +590,11 @@ RTPReceiverVideo::ReceiveMPEG4Codec(WebRtcRTPHeader* rtpHeader,
|
||||
const bool success = rtpPayloadParser.Parse(parsedPacket);
|
||||
if (!success)
|
||||
{
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
return -1;
|
||||
}
|
||||
// from here down we only work on local data
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
rtpHeader->frameType = (parsedPacket.frameType == ModuleRTPUtility::kIFrame) ? kVideoFrameKey : kVideoFrameDelta;
|
||||
rtpHeader->type.Video.isFirstPacket = parsedPacket.info.MPEG4.isFirstPacket;
|
||||
@ -622,7 +622,7 @@ RTPReceiverVideo::ReceiveVp8Codec(WebRtcRTPHeader* rtpHeader,
|
||||
const bool success = rtpPayloadParser.Parse(parsedPacket);
|
||||
|
||||
// from here down we only work on local data
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@ -681,7 +681,7 @@ RTPReceiverVideo::ReceiveGenericCodec(WebRtcRTPHeader* rtpHeader,
|
||||
{
|
||||
rtpHeader->type.Video.isFirstPacket = true;
|
||||
}
|
||||
_criticalSectionReceiverVideo.Leave();
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
if(CallbackOfReceivedPayloadData(payloadData, payloadDataLength, rtpHeader) != 0)
|
||||
{
|
||||
|
@ -132,10 +132,10 @@ private:
|
||||
WebRtc_Word32 _id;
|
||||
ModuleRtpRtcpImpl& _rtpRtcp;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionFeedback;
|
||||
CriticalSectionWrapper* _criticalSectionFeedback;
|
||||
RtpVideoFeedback* _cbVideoFeedback;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionReceiverVideo;
|
||||
CriticalSectionWrapper* _criticalSectionReceiverVideo;
|
||||
|
||||
// bandwidth
|
||||
bool _completeFrame;
|
||||
|
@ -89,8 +89,9 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const WebRtc_Word32 id,
|
||||
_lastProcessTime(clock->GetTimeInMS()),
|
||||
|
||||
_packetOverHead(28), // IPV4 UDP
|
||||
_criticalSectionModulePtrs(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionModulePtrsFeedback(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionModulePtrs(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSectionModulePtrsFeedback(
|
||||
CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_defaultModule(NULL),
|
||||
_audioModule(NULL),
|
||||
_videoModule(NULL),
|
||||
@ -165,8 +166,8 @@ ModuleRtpRtcpImpl::~ModuleRtpRtcpImpl()
|
||||
}
|
||||
#endif
|
||||
|
||||
delete &_criticalSectionModulePtrs;
|
||||
delete &_criticalSectionModulePtrsFeedback;
|
||||
delete _criticalSectionModulePtrs;
|
||||
delete _criticalSectionModulePtrsFeedback;
|
||||
}
|
||||
|
||||
WebRtc_Word32
|
||||
|
@ -544,8 +544,8 @@ private:
|
||||
WebRtc_UWord32 _lastProcessTime;
|
||||
WebRtc_UWord16 _packetOverHead;
|
||||
|
||||
CriticalSectionWrapper& _criticalSectionModulePtrs;
|
||||
CriticalSectionWrapper& _criticalSectionModulePtrsFeedback;
|
||||
CriticalSectionWrapper* _criticalSectionModulePtrs;
|
||||
CriticalSectionWrapper* _criticalSectionModulePtrsFeedback;
|
||||
ModuleRtpRtcpImpl* _defaultModule;
|
||||
ModuleRtpRtcpImpl* _audioModule;
|
||||
ModuleRtpRtcpImpl* _videoModule;
|
||||
|
@ -27,8 +27,8 @@ RTPSender::RTPSender(const WebRtc_Word32 id,
|
||||
_audioConfigured(audio),
|
||||
_audio(NULL),
|
||||
_video(NULL),
|
||||
_sendCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_transportCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_sendCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_transportCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
|
||||
_transport(NULL),
|
||||
|
||||
@ -48,7 +48,7 @@ RTPSender::RTPSender(const WebRtc_Word32 id,
|
||||
|
||||
_storeSentPackets(false),
|
||||
_storeSentPacketsNumber(0),
|
||||
_prevSentPacketsCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_prevSentPacketsCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_prevSentPacketsIndex(0),
|
||||
_ptrPrevSentPackets(NULL),
|
||||
_prevSentPacketsSeqNum(NULL),
|
||||
@ -107,9 +107,9 @@ RTPSender::~RTPSender()
|
||||
_ssrcDB.ReturnSSRC(_ssrc);
|
||||
|
||||
SSRCDatabase::ReturnSSRCDatabase();
|
||||
delete &_prevSentPacketsCritsect;
|
||||
delete &_sendCritsect;
|
||||
delete &_transportCritsect;
|
||||
delete _prevSentPacketsCritsect;
|
||||
delete _sendCritsect;
|
||||
delete _transportCritsect;
|
||||
|
||||
// empty map
|
||||
bool loop = true;
|
||||
|
@ -267,9 +267,9 @@ private:
|
||||
RTPSenderAudio* _audio;
|
||||
RTPSenderVideo* _video;
|
||||
|
||||
CriticalSectionWrapper& _sendCritsect;
|
||||
CriticalSectionWrapper* _sendCritsect;
|
||||
|
||||
CriticalSectionWrapper& _transportCritsect;
|
||||
CriticalSectionWrapper* _transportCritsect;
|
||||
Transport* _transport;
|
||||
|
||||
bool _sendingMedia;
|
||||
@ -288,7 +288,7 @@ private:
|
||||
|
||||
bool _storeSentPackets;
|
||||
WebRtc_UWord16 _storeSentPacketsNumber;
|
||||
CriticalSectionWrapper& _prevSentPacketsCritsect;
|
||||
CriticalSectionWrapper* _prevSentPacketsCritsect;
|
||||
WebRtc_Word32 _prevSentPacketsIndex;
|
||||
WebRtc_Word8** _ptrPrevSentPackets;
|
||||
WebRtc_UWord16* _prevSentPacketsSeqNum;
|
||||
|
@ -19,9 +19,9 @@ RTPSenderAudio::RTPSenderAudio(const WebRtc_Word32 id, RtpRtcpClock* clock,
|
||||
_id(id),
|
||||
_clock(*clock),
|
||||
_rtpSender(rtpSender),
|
||||
_audioFeedbackCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_audioFeedbackCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_audioFeedback(NULL),
|
||||
_sendAudioCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_sendAudioCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_frequency(8000),
|
||||
_packetSizeSamples(160),
|
||||
_dtmfEventIsOn(false),
|
||||
@ -46,8 +46,8 @@ RTPSenderAudio::RTPSenderAudio(const WebRtc_Word32 id, RtpRtcpClock* clock,
|
||||
|
||||
RTPSenderAudio::~RTPSenderAudio()
|
||||
{
|
||||
delete &_sendAudioCritsect;
|
||||
delete &_audioFeedbackCritsect;
|
||||
delete _sendAudioCritsect;
|
||||
delete _audioFeedbackCritsect;
|
||||
}
|
||||
|
||||
WebRtc_Word32
|
||||
@ -296,7 +296,7 @@ RTPSenderAudio::SendAudio(const FrameType frameType,
|
||||
// A source MAY send events and coded audio packets for the same time
|
||||
// but we don't support it
|
||||
{
|
||||
_sendAudioCritsect.Enter();
|
||||
_sendAudioCritsect->Enter();
|
||||
|
||||
if (_dtmfEventIsOn)
|
||||
{
|
||||
@ -307,7 +307,7 @@ RTPSenderAudio::SendAudio(const FrameType frameType,
|
||||
if(_packetSizeSamples > (captureTimeStamp - _dtmfTimestampLastSent) )
|
||||
{
|
||||
// not time to send yet
|
||||
_sendAudioCritsect.Leave();
|
||||
_sendAudioCritsect->Leave();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -333,7 +333,7 @@ RTPSenderAudio::SendAudio(const FrameType frameType,
|
||||
_dtmfTimeLastSent = _clock.GetTimeInMS();
|
||||
}
|
||||
// don't hold the critsect while calling SendTelephoneEventPacket
|
||||
_sendAudioCritsect.Leave();
|
||||
_sendAudioCritsect->Leave();
|
||||
if(send)
|
||||
{
|
||||
if(dtmfDurationSamples > 0xffff)
|
||||
@ -357,7 +357,7 @@ RTPSenderAudio::SendAudio(const FrameType frameType,
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
_sendAudioCritsect.Leave();
|
||||
_sendAudioCritsect->Leave();
|
||||
}
|
||||
if(payloadSize == 0 || payloadData == NULL)
|
||||
{
|
||||
@ -627,7 +627,7 @@ RTPSenderAudio::SendTelephoneEventPacket(const bool ended,
|
||||
}
|
||||
do
|
||||
{
|
||||
_sendAudioCritsect.Enter();
|
||||
_sendAudioCritsect->Enter();
|
||||
|
||||
//Send DTMF data
|
||||
_rtpSender->BuildRTPheader(dtmfbuffer, _dtmfPayloadType, markerBit, dtmfTimeStamp);
|
||||
@ -661,7 +661,7 @@ RTPSenderAudio::SendTelephoneEventPacket(const bool ended,
|
||||
dtmfbuffer[13] = E|R|volume;
|
||||
ModuleRTPUtility::AssignUWord16ToBuffer(dtmfbuffer+14, duration);
|
||||
|
||||
_sendAudioCritsect.Leave();
|
||||
_sendAudioCritsect->Leave();
|
||||
retVal = _rtpSender->SendToNetwork(dtmfbuffer, 4, 12);
|
||||
sendCount--;
|
||||
|
||||
|
@ -95,10 +95,10 @@ private:
|
||||
WebRtc_Word32 _id;
|
||||
RtpRtcpClock& _clock;
|
||||
RTPSenderInterface* _rtpSender;
|
||||
CriticalSectionWrapper& _audioFeedbackCritsect;
|
||||
CriticalSectionWrapper* _audioFeedbackCritsect;
|
||||
RtpAudioFeedback* _audioFeedback;
|
||||
|
||||
CriticalSectionWrapper& _sendAudioCritsect;
|
||||
CriticalSectionWrapper* _sendAudioCritsect;
|
||||
|
||||
WebRtc_UWord32 _frequency;
|
||||
WebRtc_UWord16 _packetSizeSamples;
|
||||
|
@ -30,7 +30,7 @@ RTPSenderVideo::RTPSenderVideo(const WebRtc_Word32 id,
|
||||
RTPSenderInterface* rtpSender) :
|
||||
_id(id),
|
||||
_rtpSender(*rtpSender),
|
||||
_sendVideoCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_sendVideoCritsect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
|
||||
_videoType(kRtpNoVideo),
|
||||
_videoCodecInformation(NULL),
|
||||
@ -63,7 +63,7 @@ RTPSenderVideo::~RTPSenderVideo()
|
||||
{
|
||||
delete _videoCodecInformation;
|
||||
}
|
||||
delete &_sendVideoCritsect;
|
||||
delete _sendVideoCritsect;
|
||||
}
|
||||
|
||||
WebRtc_Word32
|
||||
|
@ -150,7 +150,7 @@ private:
|
||||
WebRtc_Word32 _id;
|
||||
RTPSenderInterface& _rtpSender;
|
||||
|
||||
CriticalSectionWrapper& _sendVideoCritsect;
|
||||
CriticalSectionWrapper* _sendVideoCritsect;
|
||||
RtpVideoCodecTypes _videoType;
|
||||
VideoCodecInformation* _videoCodecInformation;
|
||||
WebRtc_UWord32 _maxBitrate;
|
||||
|
@ -54,7 +54,7 @@ SSRCDatabase::ReturnSSRCDatabase()
|
||||
WebRtc_UWord32
|
||||
SSRCDatabase::CreateSSRC()
|
||||
{
|
||||
CriticalSectionScoped lock(*_critSect);
|
||||
CriticalSectionScoped lock(_critSect);
|
||||
|
||||
WebRtc_UWord32 ssrc = GenerateRandom();
|
||||
|
||||
@ -103,7 +103,7 @@ SSRCDatabase::CreateSSRC()
|
||||
WebRtc_Word32
|
||||
SSRCDatabase::RegisterSSRC(const WebRtc_UWord32 ssrc)
|
||||
{
|
||||
CriticalSectionScoped lock(*_critSect);
|
||||
CriticalSectionScoped lock(_critSect);
|
||||
|
||||
#ifndef WEBRTC_NO_STL
|
||||
|
||||
@ -143,7 +143,7 @@ SSRCDatabase::RegisterSSRC(const WebRtc_UWord32 ssrc)
|
||||
WebRtc_Word32
|
||||
SSRCDatabase::ReturnSSRC(const WebRtc_UWord32 ssrc)
|
||||
{
|
||||
CriticalSectionScoped lock(*_critSect);
|
||||
CriticalSectionScoped lock(_critSect);
|
||||
|
||||
#ifndef WEBRTC_NO_STL
|
||||
_ssrcMap.erase(ssrc);
|
||||
|
@ -62,7 +62,7 @@ TMMBRSet::VerifyAndAllocateSet(WebRtc_UWord32 minimumSize)
|
||||
}
|
||||
|
||||
TMMBRHelp::TMMBRHelp(const bool audio) :
|
||||
_criticalSection(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_criticalSection(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_audio(audio),
|
||||
_candidateSet(),
|
||||
_boundingSet(),
|
||||
@ -78,7 +78,7 @@ TMMBRHelp::~TMMBRHelp()
|
||||
delete [] _ptrMaxPRBoundingSet;
|
||||
_ptrIntersectionBoundingSet = 0;
|
||||
_ptrMaxPRBoundingSet = 0;
|
||||
delete &_criticalSection;
|
||||
delete _criticalSection;
|
||||
}
|
||||
|
||||
TMMBRSet*
|
||||
|
@ -65,7 +65,7 @@ protected:
|
||||
WebRtc_Word32 FindTMMBRBoundingSet(WebRtc_Word32 numCandidates, TMMBRSet& candidateSet);
|
||||
|
||||
private:
|
||||
CriticalSectionWrapper& _criticalSection;
|
||||
CriticalSectionWrapper* _criticalSection;
|
||||
const bool _audio;
|
||||
TMMBRSet _candidateSet;
|
||||
TMMBRSet _boundingSet;
|
||||
|
@ -199,7 +199,7 @@ _eventPtr(NULL),
|
||||
_procThread(NULL),
|
||||
_startTimeMs(-1),
|
||||
_stopTimeMs(-1),
|
||||
_statCritSect(*CriticalSectionWrapper::CreateCriticalSection())
|
||||
_statCritSect(CriticalSectionWrapper::CreateCriticalSection())
|
||||
{
|
||||
_sendrec = new TestSenderReceiver();
|
||||
}
|
||||
@ -212,7 +212,7 @@ BWETest::~BWETest()
|
||||
Stop();
|
||||
}
|
||||
|
||||
_statCritSect.Enter();
|
||||
_statCritSect->Enter();
|
||||
delete &_statCritSect;
|
||||
|
||||
if (_sendrec)
|
||||
|
@ -76,7 +76,7 @@ protected:
|
||||
WebRtc_Word64 _stopTimeMs;
|
||||
|
||||
// Statistics, protected by separate CritSect
|
||||
CriticalSectionWrapper& _statCritSect;
|
||||
CriticalSectionWrapper* _statCritSect;
|
||||
StatVec _rateVecKbps;
|
||||
StatVec _rttVecMs;
|
||||
StatVec _lossVec;
|
||||
|
@ -386,7 +386,7 @@ _firstPlot(true),
|
||||
_legendEnabled(true),
|
||||
_donePlottingEvent(EventWrapper::Create())
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
_xlim[0] = 0;
|
||||
_xlim[1] = 0;
|
||||
@ -419,7 +419,7 @@ MatlabPlot::~MatlabPlot()
|
||||
|
||||
int MatlabPlot::AddLine(int maxLen /*= -1*/, const char *plotAttrib /*= NULL*/, const char *name /*= NULL*/)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
if (!_enabled)
|
||||
{
|
||||
return -1;
|
||||
@ -435,7 +435,7 @@ int MatlabPlot::AddLine(int maxLen /*= -1*/, const char *plotAttrib /*= NULL*/,
|
||||
int MatlabPlot::AddTimeLine(int maxLen /*= -1*/, const char *plotAttrib /*= NULL*/, const char *name /*= NULL*/,
|
||||
WebRtc_Word64 refTimeMs /*= -1*/)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -451,7 +451,7 @@ int MatlabPlot::AddTimeLine(int maxLen /*= -1*/, const char *plotAttrib /*= NULL
|
||||
|
||||
int MatlabPlot::GetLineIx(const char *name)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -485,7 +485,7 @@ int MatlabPlot::GetLineIx(const char *name)
|
||||
|
||||
void MatlabPlot::Append(int lineIndex, double x, double y)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -505,7 +505,7 @@ void MatlabPlot::Append(int lineIndex, double x, double y)
|
||||
|
||||
void MatlabPlot::Append(int lineIndex, double y)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -525,7 +525,7 @@ void MatlabPlot::Append(int lineIndex, double y)
|
||||
|
||||
int MatlabPlot::Append(const char *name, double x, double y)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -548,7 +548,7 @@ int MatlabPlot::Append(const char *name, double x, double y)
|
||||
|
||||
int MatlabPlot::Append(const char *name, double y)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -571,7 +571,7 @@ int MatlabPlot::Append(const char *name, double y)
|
||||
|
||||
int MatlabPlot::Length(char *name)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -592,7 +592,7 @@ int MatlabPlot::Length(char *name)
|
||||
|
||||
void MatlabPlot::SetPlotAttribute(char *name, char *plotAttrib)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (!_enabled)
|
||||
{
|
||||
@ -789,7 +789,7 @@ bool MatlabPlot::DataAvailable()
|
||||
|
||||
void MatlabPlot::Plot()
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
_timeToPlot = true;
|
||||
|
||||
@ -801,7 +801,7 @@ void MatlabPlot::Plot()
|
||||
|
||||
void MatlabPlot::Reset()
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
_enabled = true;
|
||||
|
||||
@ -814,7 +814,7 @@ void MatlabPlot::Reset()
|
||||
|
||||
void MatlabPlot::SetFigHandle(int handle)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (handle > 0)
|
||||
_figHandle = handle;
|
||||
@ -823,21 +823,21 @@ void MatlabPlot::SetFigHandle(int handle)
|
||||
bool
|
||||
MatlabPlot::TimeToPlot()
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
return _enabled && _timeToPlot;
|
||||
}
|
||||
|
||||
void
|
||||
MatlabPlot::Plotting()
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
_plotting = true;
|
||||
}
|
||||
|
||||
void
|
||||
MatlabPlot::DonePlotting()
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
_timeToPlot = false;
|
||||
_plotting = false;
|
||||
_donePlottingEvent->Set();
|
||||
@ -858,7 +858,7 @@ MatlabPlot::DisablePlot()
|
||||
|
||||
int MatlabPlot::MakeTrend(const char *sourceName, const char *trendName, double slope, double offset, const char *plotAttrib)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
int sourceIx;
|
||||
int trendIx;
|
||||
@ -941,7 +941,7 @@ MatlabEngine::~MatlabEngine()
|
||||
|
||||
MatlabPlot * MatlabEngine::NewPlot(MatlabPlot *newPlot)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
//MatlabPlot *newPlot = new MatlabPlot();
|
||||
|
||||
@ -958,7 +958,7 @@ MatlabPlot * MatlabEngine::NewPlot(MatlabPlot *newPlot)
|
||||
|
||||
void MatlabEngine::DeletePlot(MatlabPlot *plot)
|
||||
{
|
||||
CriticalSectionScoped cs(*_critSect);
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
|
||||
if (plot == NULL)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ bool SenderThreadFunction(void *obj)
|
||||
|
||||
TestLoadGenerator::TestLoadGenerator(TestSenderReceiver *sender, WebRtc_Word32 rtpSampleRate)
|
||||
:
|
||||
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_critSect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_eventPtr(NULL),
|
||||
_genThread(NULL),
|
||||
_bitrateKbps(0),
|
||||
@ -50,7 +50,7 @@ TestLoadGenerator::~TestLoadGenerator ()
|
||||
Stop();
|
||||
}
|
||||
|
||||
delete &_critSect;
|
||||
delete _critSect;
|
||||
}
|
||||
|
||||
WebRtc_Word32 TestLoadGenerator::SetBitrate (WebRtc_Word32 newBitrateKbps)
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
const WebRtc_UWord32 payloadSize,
|
||||
const webrtc::FrameType frameType = webrtc::kVideoFrameDelta);
|
||||
|
||||
webrtc::CriticalSectionWrapper& _critSect;
|
||||
webrtc::CriticalSectionWrapper* _critSect;
|
||||
webrtc::EventWrapper *_eventPtr;
|
||||
webrtc::ThreadWrapper* _genThread;
|
||||
WebRtc_Word32 _bitrateKbps;
|
||||
|
@ -37,7 +37,7 @@ bool ProcThreadFunction(void *obj)
|
||||
|
||||
TestSenderReceiver::TestSenderReceiver (void)
|
||||
:
|
||||
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_critSect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_eventPtr(NULL),
|
||||
_procThread(NULL),
|
||||
_running(false),
|
||||
@ -85,7 +85,7 @@ TestSenderReceiver::~TestSenderReceiver (void)
|
||||
|
||||
Stop(); // N.B. without critSect
|
||||
|
||||
_critSect.Enter();
|
||||
_critSect->Enter();
|
||||
|
||||
if (_rtp)
|
||||
{
|
||||
@ -99,7 +99,7 @@ TestSenderReceiver::~TestSenderReceiver (void)
|
||||
_transport = NULL;
|
||||
}
|
||||
|
||||
delete &_critSect;
|
||||
delete _critSect;
|
||||
|
||||
}
|
||||
|
||||
@ -440,5 +440,3 @@ void TestSenderReceiver::OnNetworkChanged(const WebRtc_Word32 id,
|
||||
bwEstimateKbitMax);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
private:
|
||||
RtpRtcp* _rtp;
|
||||
UdpTransport* _transport;
|
||||
webrtc::CriticalSectionWrapper& _critSect;
|
||||
webrtc::CriticalSectionWrapper* _critSect;
|
||||
webrtc::EventWrapper *_eventPtr;
|
||||
webrtc::ThreadWrapper* _procThread;
|
||||
bool _running;
|
||||
|
Loading…
x
Reference in New Issue
Block a user