org.ow2.clif.probe.rtp
Class ParticipantStats

java.lang.Object
  extended by org.ow2.clif.probe.rtp.ParticipantStats

public class ParticipantStats
extends java.lang.Object

Class to keep statistics about each participants.

Author:
Remi Druilhe

Constructor Summary
ParticipantStats(java.lang.Long ssrc, java.lang.Integer seqNum, java.lang.Integer port)
          Constructor
 
Method Summary
 void calculateCumulativePacketLost()
          Calculate the number of packets lost according to the RFC 3550.
 void calculateFractionLost()
          Calculate the fraction lost according to the RFC 3550.
 java.lang.Long calculateLsr(java.lang.Long MswNtpTimestamp, java.lang.Long LswNtpTimestamp)
          Calculate the LSR according to the RFC 3550.
 void calculateSeqNumMax(java.lang.Integer sequenceNumber)
          Compare the sequence number with the previous maximum calculated.
 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.
 java.lang.Integer getCumulativePacketLost()
           
 java.lang.Integer getCycle()
           
 java.lang.Long getDlsr()
           
 boolean getFirstReport()
           
 java.lang.Integer getFractionLost()
           
 java.lang.Integer getLastPacketSum()
           
 java.lang.Long getLastTimeJitterSum()
           
 java.lang.Long getLastTimeJitterSumSquare()
           
 java.lang.Long getLsr()
           
 boolean getNewMeasure()
           
 java.lang.Integer getPacketSum()
           
 java.lang.Integer getPort()
           
 java.lang.Long getPreviousTime()
           
 java.lang.Integer getSeqNumMax()
           
 java.lang.Long getSsrc()
           
 java.lang.Long getTimeJitter()
           
 java.lang.Long getTimeJitterSum()
           
 java.lang.Long getTimeJitterSumSquare()
           
 void incPacketSum()
          Increment number of packet by 1.
 void newMeasure()
          Start a new measure.
 void rtpReceiver()
          If the participant doesn't send RTP packet, he becomes a receiver.
 void rtpSender()
          If the participant send RTP packet, he becomes a sender.
 void setDlsr(java.lang.Long time)
           
 void setFirstReport()
           
 void setLastSeqNum(java.lang.Integer sequenceNumber)
           
 void setLsr(java.lang.Long lsr)
           
 void setPacketSum(java.lang.Integer packetSum)
           
 void setPreviousSeqNum(java.lang.Integer previousSeqNum)
           
 void setPreviousTime(java.lang.Long previousTime)
           
 void setPreviousTimestamp(java.lang.Long previousTimestamp)
           
 void setSampling(java.lang.Double sampling)
           
 void setSsrc(java.lang.Long ssrc)
           
 void setTimeJitter(java.lang.Long timeJitter)
           
 void setTimeJitterSum(java.lang.Long timeJitterSum)
           
 void setTimeJitterSumSquare(java.lang.Long timeJitterSumSquare)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)