public class RetransmissionRequesterDelegate extends java.lang.Object implements RecurringRunnable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_MISSING
If more than MAX_MISSING consecutive packets are lost, we will
not request retransmissions for them, but reset our state instead.
|
static int |
MAX_REQUESTS
The maximum number of retransmission requests to be sent for a single
RTP packet.
|
static int |
RE_REQUEST_AFTER_MILLIS
The interval after which another retransmission request will be sent
for a packet, unless it arrives.
|
protected TimeProvider |
timeProvider |
static long |
WAKEUP_INTERVAL_MILLIS
The interval we'll ask the
RecurringRunnableExecutor to 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 |
protected java.lang.Runnable |
workReadyCallback
A callback which allows this class to signal it has nack work that is ready
to be run
|
Constructor and Description |
---|
RetransmissionRequesterDelegate(MediaStream stream,
TimeProvider timeProvider)
Initializes a new RetransmissionRequesterDelegate for the given
RtpChannel.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<NACKPacket> |
createNackPackets(long now,
java.util.List<org.jitsi.impl.neomedia.transform.RetransmissionRequesterDelegate.Requester> dueRequesters)
Gather the packets currently marked as missing and create
NACKs for them
|
long |
getTimeUntilNextRun()
Returns the number of milliseconds until this instance wants a worker
thread to call
Runnable.run() . |
void |
packetReceived(long ssrc,
int seqNum)
Notify this requester that a packet has been received
|
void |
run() |
void |
setSenderSsrc(long ssrc) |
void |
setWorkReadyCallback(java.lang.Runnable workReadyCallback) |
public static final int MAX_MISSING
public static final int MAX_REQUESTS
public static final int RE_REQUEST_AFTER_MILLIS
public static final long WAKEUP_INTERVAL_MILLIS
RecurringRunnableExecutor
to 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 final TimeProvider timeProvider
protected java.lang.Runnable workReadyCallback
public RetransmissionRequesterDelegate(MediaStream stream, TimeProvider timeProvider)
stream
- the MediaStream
that the instance belongs to.public void packetReceived(long ssrc, int seqNum)
public long getTimeUntilNextRun()
Runnable.run()
. The method is called on the same
worker thread as Process will be called on.getTimeUntilNextRun
in interface RecurringRunnable
Runnable.run()
public void setWorkReadyCallback(java.lang.Runnable workReadyCallback)
public void run()
run
in interface java.lang.Runnable
protected java.util.List<NACKPacket> createNackPackets(long now, java.util.List<org.jitsi.impl.neomedia.transform.RetransmissionRequesterDelegate.Requester> dueRequesters)
dueRequesters
- the requesters which are due to have nack packets
generatedpublic void setSenderSsrc(long ssrc)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.