Package org.ow2.clif.probe.rtp
Class ParticipantStats
- java.lang.Object
-
- org.ow2.clif.probe.rtp.ParticipantStats
-
public class ParticipantStats extends java.lang.ObjectClass to keep statistics about each participants.- Author:
- Remi Druilhe
-
-
Constructor Summary
Constructors Constructor Description ParticipantStats(java.lang.Long ssrc, java.lang.Integer seqNum, java.lang.Integer port)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcalculateCumulativePacketLost()Calculate the number of packets lost according to the RFC 3550.voidcalculateFractionLost()Calculate the fraction lost according to the RFC 3550.java.lang.LongcalculateLsr(java.lang.Long MswNtpTimestamp, java.lang.Long LswNtpTimestamp)Calculate the LSR according to the RFC 3550.voidcalculateSeqNumMax(java.lang.Integer sequenceNumber)Compare the sequence number with the previous maximum calculated.voidcalculateTimeJitter(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.IntegergetCumulativePacketLost()java.lang.IntegergetCycle()java.lang.LonggetDlsr()booleangetFirstReport()java.lang.IntegergetFractionLost()java.lang.IntegergetLastPacketSum()java.lang.LonggetLastTimeJitterSum()java.lang.LonggetLastTimeJitterSumSquare()java.lang.LonggetLsr()booleangetNewMeasure()java.lang.IntegergetPacketSum()java.lang.IntegergetPort()java.lang.LonggetPreviousTime()java.lang.IntegergetSeqNumMax()java.lang.LonggetSsrc()java.lang.LonggetTimeJitter()java.lang.LonggetTimeJitterSum()java.lang.LonggetTimeJitterSumSquare()voidincPacketSum()Increment number of packet by 1.voidnewMeasure()Start a new measure.voidrtpReceiver()If the participant doesn't send RTP packet, he becomes a receiver.voidrtpSender()If the participant send RTP packet, he becomes a sender.voidsetDlsr(java.lang.Long time)voidsetFirstReport()voidsetLastSeqNum(java.lang.Integer sequenceNumber)voidsetLsr(java.lang.Long lsr)voidsetPacketSum(java.lang.Integer packetSum)voidsetPreviousSeqNum(java.lang.Integer previousSeqNum)voidsetPreviousTime(java.lang.Long previousTime)voidsetPreviousTimestamp(java.lang.Long previousTimestamp)voidsetSampling(java.lang.Double sampling)voidsetSsrc(java.lang.Long ssrc)voidsetTimeJitter(java.lang.Long timeJitter)voidsetTimeJitterSum(java.lang.Long timeJitterSum)voidsetTimeJitterSumSquare(java.lang.Long timeJitterSumSquare)
-
-
-
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)
-
-