Skip to content
Snippets Groups Projects
Commit 39c656f2 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#4367] Reduce packet receive/sent timeout

parent ca392121
Branches
Tags
No related merge requests found
......@@ -47,8 +47,8 @@ namespace sfl
// Factor use to increase volume in fade in
#define FADEIN_STEP_SIZE 4;
static const int schedulingTimeout = 100000;
static const int expireTimeout = 1000000;
static const int schedulingTimeout = 10000;
static const int expireTimeout = 100000;
class AudioRtpSessionException: public std::exception
{
......
......@@ -72,7 +72,7 @@ AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) :
// static_cast<ost::DualRTPUDPIPv4Channel>(dso)->sendSocket->setTypeOfService(ost::Socket::tosLowDelay);
// static_cast<ost::DualRTPChannel<ost::DualRTPUDPIPv4Channel> >(dso)->sendSocket->setTypeOfService(ost::Socket::tosLowDelay);
setTypeOfService(tosEnhanced);
// setTypeOfService(tosEnhanced);
}
AudioRtpSession::~AudioRtpSession()
......@@ -261,6 +261,7 @@ void AudioRtpSession::sendMicData()
// putData put the data on RTP queue, sendImmediate bypass this queue
putData (_timestamp, getMicDataEncoded(), compSize);
// sendData()
}
......@@ -347,10 +348,12 @@ void AudioRtpSession::run ()
uint32 timeout = 0;
while ( isActive() ) {
if ( timeout < 100 ){ // !(timeout/1000)
if ( timeout < 1000 ){ // !(timeout/1000)
timeout = getSchedulingTimeout();
}
// timeout = ;
_manager->getAudioLayerMutex()->enter();
// Send session
......@@ -360,6 +363,8 @@ void AudioRtpSession::run ()
sendMicData ();
}
receiveSpeakerData();
// This also should be moved
notifyIncomingCall();
......@@ -373,14 +378,17 @@ void AudioRtpSession::run ()
// make sure the scheduling timeout is
// <= the check interval for RTCP
// packets
_debug("timeout before: %d, maxwait %d", timeout, maxWait);
timeout = (timeout > maxWait)? maxWait : timeout;
if ( timeout < 100 ) { // !(timeout/1000)
_debug("timeout after: %d", timeout);
if ( timeout < 1000 ) { // !(timeout/1000)
setCancel(cancelDeferred);
dispatchDataPacket();
setCancel(cancelImmediate);
timerTick();
} else {
if ( isPendingData(timeout/100) ) {
if ( isPendingData(timeout/1000) ) {
setCancel(cancelDeferred);
if (isActive()) { // take in only if active
takeInDataPacket();
......@@ -389,8 +397,6 @@ void AudioRtpSession::run ()
}
timeout = 0;
}
receiveSpeakerData();
}
_debug ("AudioRtpSession: Left main loop for call %s", _ca->getCallId().c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment