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