Class RetransmissionRequesterDelegate
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.RetransmissionRequesterDelegate
-
- All Implemented Interfaces:
Runnable,org.jitsi.utils.concurrent.RecurringRunnable
public class RetransmissionRequesterDelegate extends Object implements org.jitsi.utils.concurrent.RecurringRunnable
Detects lost RTP packets for a particular RtpChannel and requests their retransmission by sending RTCP NACK packets.- Author:
- Boris Grozev, George Politis, bbaldino
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_MISSINGIf more than MAX_MISSING consecutive packets are lost, we will not request retransmissions for them, but reset our state instead.static intMAX_REQUESTSThe maximum number of retransmission requests to be sent for a single RTP packet.static intRE_REQUEST_AFTER_MILLISThe interval after which another retransmission request will be sent for a packet, unless it arrives.protected org.jitsi.utils.TimeProvidertimeProviderstatic longWAKEUP_INTERVAL_MILLISThe interval we'll ask theRecurringRunnableExecutorto check back in if there is no current work TODO(brian): i think we should actually be able to get rid of this and just rely on scheduled work and the 'work ready now' callbackprotected RunnableworkReadyCallbackA callback which allows this class to signal it has nack work that is ready to be run
-
Constructor Summary
Constructors Constructor Description RetransmissionRequesterDelegate(MediaStream stream, org.jitsi.utils.TimeProvider timeProvider)Initializes a new RetransmissionRequesterDelegate for the given RtpChannel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<NACKPacket>createNackPackets(long now, List<org.jitsi.impl.neomedia.transform.RetransmissionRequesterDelegate.Requester> dueRequesters)Gather the packets currently marked as missing and create NACKs for themlonggetTimeUntilNextRun()voidpacketReceived(long ssrc, int seqNum)Notify this requester that a packet has been receivedvoidrun()voidsetSenderSsrc(long ssrc)voidsetWorkReadyCallback(Runnable workReadyCallback)
-
-
-
Field Detail
-
MAX_MISSING
public static final int MAX_MISSING
If more than MAX_MISSING consecutive packets are lost, we will not request retransmissions for them, but reset our state instead.- See Also:
- Constant Field Values
-
MAX_REQUESTS
public static final int MAX_REQUESTS
The maximum number of retransmission requests to be sent for a single RTP packet.- See Also:
- Constant Field Values
-
RE_REQUEST_AFTER_MILLIS
public static final int RE_REQUEST_AFTER_MILLIS
The interval after which another retransmission request will be sent for a packet, unless it arrives. Ideally this should not be a constant, but should be based on the RTT to the endpoint.- See Also:
- Constant Field Values
-
WAKEUP_INTERVAL_MILLIS
public static final long WAKEUP_INTERVAL_MILLIS
The interval we'll ask theRecurringRunnableExecutorto check back in if there is no current work TODO(brian): i think we should actually be able to get rid of this and just rely on scheduled work and the 'work ready now' callback- See Also:
- Constant Field Values
-
timeProvider
protected final org.jitsi.utils.TimeProvider timeProvider
-
workReadyCallback
protected Runnable workReadyCallback
A callback which allows this class to signal it has nack work that is ready to be run
-
-
Constructor Detail
-
RetransmissionRequesterDelegate
public RetransmissionRequesterDelegate(MediaStream stream, org.jitsi.utils.TimeProvider timeProvider)
Initializes a new RetransmissionRequesterDelegate for the given RtpChannel.- Parameters:
stream- theMediaStreamthat the instance belongs to.
-
-
Method Detail
-
packetReceived
public void packetReceived(long ssrc, int seqNum)Notify this requester that a packet has been received
-
getTimeUntilNextRun
public long getTimeUntilNextRun()
- Specified by:
getTimeUntilNextRunin interfaceorg.jitsi.utils.concurrent.RecurringRunnable
-
setWorkReadyCallback
public void setWorkReadyCallback(Runnable workReadyCallback)
-
createNackPackets
protected List<NACKPacket> createNackPackets(long now, List<org.jitsi.impl.neomedia.transform.RetransmissionRequesterDelegate.Requester> dueRequesters)
Gather the packets currently marked as missing and create NACKs for them- Parameters:
dueRequesters- the requesters which are due to have nack packets generated
-
setSenderSsrc
public void setSenderSsrc(long ssrc)
-
-