Class ParticipantStats


  • public class ParticipantStats
    extends java.lang.Object
    Class to keep statistics about each participants.
    Author:
    Remi Druilhe
    • Constructor Detail

      • ParticipantStats

        public ParticipantStats​(java.lang.Long ssrc,
                                java.lang.Integer seqNum,
                                java.lang.Integer port)
        Constructor
        Parameters:
        ssrc - : the SSRC of the participant.
        seqNum - : the sequence number of the first RTP packet of the participant.
        port - : the RTP port of the participant.
    • Method Detail

      • incPacketSum

        public void incPacketSum()
        Increment number of packet by 1.
      • calculateTimeJitter

        public void calculateTimeJitter​(java.lang.Long time,
                                        java.lang.Long timestamp)
        Calculate the time jitter, the sum of time jitter and the sum of square time jitter according to the RFC 3550.
        Parameters:
        time - : the receive time of the last RTP packet.
        timestamp - : the receive timestamp of the last RTP packet.
      • calculateSeqNumMax

        public void calculateSeqNumMax​(java.lang.Integer sequenceNumber)
        Compare the sequence number with the previous maximum calculated.
        Parameters:
        sequenceNumber - : the sequence number to compare with the max.
      • calculateFractionLost

        public void calculateFractionLost()
        Calculate the fraction lost according to the RFC 3550.
      • calculateCumulativePacketLost

        public void calculateCumulativePacketLost()
        Calculate the number of packets lost according to the RFC 3550.
      • newMeasure

        public void newMeasure()
        Start a new measure. Useful for the next RTCP packet.
      • calculateLsr

        public java.lang.Long calculateLsr​(java.lang.Long MswNtpTimestamp,
                                           java.lang.Long LswNtpTimestamp)
        Calculate the LSR according to the RFC 3550.
        Parameters:
        MswNtpTimestamp - : the MSW NTP timestamp of the SR report.
        LswNtpTimestamp - : the LSW NTP timestamp of the SR report.
        Returns:
        the 32 middle bits of the NTP timestamp.
      • rtpSender

        public void rtpSender()
        If the participant send RTP packet, he becomes a sender.
      • rtpReceiver

        public void rtpReceiver()
        If the participant doesn't send RTP packet, he becomes a receiver.
      • getPacketSum

        public java.lang.Integer getPacketSum()
      • getLastPacketSum

        public java.lang.Integer getLastPacketSum()
      • getTimeJitter

        public java.lang.Long getTimeJitter()
      • getTimeJitterSum

        public java.lang.Long getTimeJitterSum()
      • getLastTimeJitterSum

        public java.lang.Long getLastTimeJitterSum()
      • getTimeJitterSumSquare

        public java.lang.Long getTimeJitterSumSquare()
      • getLastTimeJitterSumSquare

        public java.lang.Long getLastTimeJitterSumSquare()
      • getCycle

        public java.lang.Integer getCycle()
      • getSeqNumMax

        public java.lang.Integer getSeqNumMax()
      • getSsrc

        public java.lang.Long getSsrc()
      • getLsr

        public java.lang.Long getLsr()
      • getDlsr

        public java.lang.Long getDlsr()
      • getNewMeasure

        public boolean getNewMeasure()
      • getFirstReport

        public boolean getFirstReport()
      • getPort

        public java.lang.Integer getPort()
      • getPreviousTime

        public java.lang.Long getPreviousTime()
      • getFractionLost

        public java.lang.Integer getFractionLost()
      • getCumulativePacketLost

        public java.lang.Integer getCumulativePacketLost()
      • setPacketSum

        public void setPacketSum​(java.lang.Integer packetSum)
      • setTimeJitter

        public void setTimeJitter​(java.lang.Long timeJitter)
      • setTimeJitterSum

        public void setTimeJitterSum​(java.lang.Long timeJitterSum)
      • setTimeJitterSumSquare

        public void setTimeJitterSumSquare​(java.lang.Long timeJitterSumSquare)
      • setPreviousTime

        public void setPreviousTime​(java.lang.Long previousTime)
      • setPreviousTimestamp

        public void setPreviousTimestamp​(java.lang.Long previousTimestamp)
      • setPreviousSeqNum

        public void setPreviousSeqNum​(java.lang.Integer previousSeqNum)
      • setSampling

        public void setSampling​(java.lang.Double sampling)
      • setSsrc

        public void setSsrc​(java.lang.Long ssrc)
      • setLsr

        public void setLsr​(java.lang.Long lsr)
      • setDlsr

        public void setDlsr​(java.lang.Long time)
      • setFirstReport

        public void setFirstReport()
      • setLastSeqNum

        public void setLastSeqNum​(java.lang.Integer sequenceNumber)