Class RTPStats

  • All Implemented Interfaces:
    java.lang.Runnable

    public class RTPStats
    extends java.lang.Thread
    Thread to return statistics about RTP. To calculate jitter, please refer to RFC 3550.
    Author:
    Rémi Druilhe
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRtcpPortToList​(java.lang.Integer port)
      Add a port to a list to avoid decoding UDP packets from this port as RTP packets.
      void close()
      Close RTPStats by stopping thread
      java.util.ArrayList<ParticipantStats> getByeList()
      Returns the list of participants which have sent a BYE packet.
      static RTPStats getInstance()
      Create or get the single instance of the thread.
      java.util.ArrayList<ParticipantStats> getParticipantsStats()
      Update statistics for each participants
      long[] getResults()
      Generate statistics for monitoring every seconds.
      void openStats​(java.util.ArrayList<java.lang.Integer> listeningPorts)
      Open sockets using RTPListener.java
      void run()  
      void startStats()
      Start the thread of the singleton if it hasn't been started yet.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getInstance

        public static RTPStats getInstance()
        Create or get the single instance of the thread.
        Returns:
        the single instance of the thread
      • openStats

        public void openStats​(java.util.ArrayList<java.lang.Integer> listeningPorts)
        Open sockets using RTPListener.java
        Parameters:
        listeningPorts - : a list of ports to open.
      • startStats

        public void startStats()
        Start the thread of the singleton if it hasn't been started yet.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
        See Also:
        Thread.run()
      • getResults

        public long[] getResults()
        Generate statistics for monitoring every seconds. 0 : Packets number 1 : Cumulative number of packets lost 2 : Minimum of time jitter. 3 : Maximum of time jitter. 4 : Average of time jitter. 5 : Standard deviation of time jitter. 6 : Number of jumped packets per second. 7 : Number of inverted packets per second.
        Returns:
        the results
      • getParticipantsStats

        public java.util.ArrayList<ParticipantStats> getParticipantsStats()
        Update statistics for each participants
        Returns:
        the statistics for each participants
      • close

        public void close()
        Close RTPStats by stopping thread
      • addRtcpPortToList

        public void addRtcpPortToList​(java.lang.Integer port)
        Add a port to a list to avoid decoding UDP packets from this port as RTP packets.
        Parameters:
        port - : the port to add to the RtcpPortList
      • getByeList

        public java.util.ArrayList<ParticipantStats> getByeList()
        Returns the list of participants which have sent a BYE packet.
        Returns:
        the list of participants.