Class 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 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 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
        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 - the MediaStream that 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:
        getTimeUntilNextRun in interface org.jitsi.utils.concurrent.RecurringRunnable
      • setWorkReadyCallback

        public void setWorkReadyCallback​(Runnable workReadyCallback)
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • 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)