public class MediaStreamStatsImpl extends java.lang.Object implements MediaStreamStats
MediaStreamStats2Impl
instead, where we can manage the complexity
and consistency better.Modifier and Type | Class and Description |
---|---|
static class |
MediaStreamStatsImpl.StreamDirection
Enumeration of the direction (DOWNLOAD or UPLOAD) used for the stats.
|
Constructor and Description |
---|
MediaStreamStatsImpl(MediaStreamImpl mediaStreamImpl)
Creates a new instance of stats concerning a MediaStream.
|
Modifier and Type | Method and Description |
---|---|
void |
addRTCPPacketListener(RTCPPacketListener listener)
Adds a listener which will be notified when RTCP packets are received.
|
double |
getAvgDownloadJitterMs()
Gets the average of the RTP jitter values reported to us in RTCP reports,
in milliseconds.
|
double |
getAvgUploadJitterMs()
Gets the average of the RTP jitter values reported to us in RTCP reports,
in milliseconds.
|
double |
getDownloadJitterMs()
Returns the jitter average of this download stream.
|
long |
getDownloadNbPacketLost()
Returns the number of lost packets for the receive streams.
|
double |
getDownloadPercentLoss()
Returns the percent loss of the download stream.
|
double |
getDownloadRateKiloBitPerSec()
Returns the bandwidth used by this download stream.
|
java.awt.Dimension |
getDownloadVideoSize()
Returns the download video size if this stream downloads a video, or
null if not.
|
java.lang.String |
getEncoding()
Returns the MediaStream enconding.
|
java.lang.String |
getEncodingClockRate()
Returns the MediaStream enconding rate (in Hz)..
|
static javax.media.control.JitterBufferControl |
getJitterBufferControl(javax.media.rtp.ReceiveStream receiveStream)
Gets the JitterBufferControl of a ReceiveStream.
|
int |
getJitterBufferDelayMs()
Returns the delay in milliseconds introduced by the jitter buffer.
|
int |
getJitterBufferDelayPackets()
Returns the delay in number of packets introduced by the jitter buffer.
|
java.lang.String |
getLocalIPAddress()
Returns the local IP address of the MediaStream.
|
int |
getLocalPort()
Returns the local port of the MediaStream.
|
double |
getMaxDownloadJitterMs()
Gets the maximum RTP jitter value reported by us in an RTCP report, in
milliseconds.
|
double |
getMaxUploadJitterMs()
Gets the maximum RTP jitter value reported to us in an RTCP report, in
milliseconds.
|
double |
getMinDownloadJitterMs()
Gets the minimum RTP jitter value reported by us in an RTCP report, in
milliseconds.
|
double |
getMinUploadJitterMs()
Gets the minimum RTP jitter value reported to us in an RTCP report, in
milliseconds.
|
long |
getNbDiscarded()
Returns the total number of Protocol Data Units (PDU) discarded by the
FMJ packet queue since the beginning of the session.
|
int |
getNbDiscardedFull()
Returns the number of Protocol Data Units (PDU) discarded by the
FMJ packet queue since the beginning of the session because it was full.
|
int |
getNbDiscardedLate()
Returns the number of Protocol Data Units (PDU) discarded by the
FMJ packet queue since the beginning of the session because they were late.
|
int |
getNbDiscardedReset()
Returns the number of Protocol Data Units (PDU) discarded by the
FMJ packet queue since the beginning of the session during resets.
|
int |
getNbDiscardedShrink()
Returns the number of Protocol Data Units (PDU) discarded by the
FMJ packet queue since the beginning of the session due to shrinking.
|
long |
getNbFec()
Returns the number of packets for which FEC data was decoded.
|
long |
getNbPackets()
Returns the total number of packets that are send or receive for this
stream since the stream is created.
|
long |
getNbPacketsLost()
Returns the number of lost packets for that stream.
|
long |
getNbPacketsReceived()
Returns the number of packets received since the beginning of the
session.
|
long |
getNbPacketsSent()
Returns the number of packets sent since the beginning of the session.
|
long |
getNbReceivedBytes()
Returns the number of received bytes since the beginning of the
session.
|
long |
getNbSentBytes()
Returns the number of sent bytes since the beginning of the
session.
|
int |
getPacketQueueCountPackets()
Returns the number of packets in the first JitterBufferControl
found via getJitterBufferControls.
|
int |
getPacketQueueSize()
Returns the size of the first JitterBufferControl found via
getJitterBufferControls.
|
double |
getPercentDiscarded()
Returns the percent of discarded packets
|
java.lang.String |
getRemoteIPAddress()
Returns the remote IP address of the MediaStream.
|
int |
getRemotePort()
Returns the remote port of the MediaStream.
|
RTCPReports |
getRTCPReports()
Gets the detailed statistics about the RTCP reports sent and received by
the associated local peer.
|
long |
getRttMs()
Returns the RTT computed with the RTCP feedback (cf.
|
long |
getSendingBitrate()
Gets the rate at which we are currently sending data to the remote
endpoint in bits per second.
|
double |
getUploadJitterMs()
Returns the jitter average of this upload stream.
|
long |
getUploadNbPacketLost()
Returns the total number of sent packets lost.
|
double |
getUploadPercentLoss()
Returns the percent loss of the upload stream.
|
double |
getUploadRateKiloBitPerSec()
Returns the bandwidth used by this download stream.
|
java.awt.Dimension |
getUploadVideoSize()
Returns the upload video size if this stream uploads a video, or null if
not.
|
boolean |
isAdaptiveBufferEnabled()
Checks whether there is an adaptive jitter buffer enabled for at least
one of the ReceiveStreams of the MediaStreamImpl.
|
void |
nackReceived(NACKPacket nack)
Notifies this instance that an RTCP NACK packet was received.
|
void |
rembReceived(RTCPREMBPacket remb)
Notifies this instance that an RTCP REMB packet was received.
|
void |
removeRTCPPacketListener(RTCPPacketListener listener)
Removes a listener from the list of listeners which will be notified when
RTCP packets are received.
|
void |
srReceived(net.sf.fmj.media.rtp.RTCPSRPacket sr)
Notifies this instance that an RTCP SR packet was received.
|
void |
tccPacketReceived(RTCPTCCPacket tccPacket)
Notifies listeners that a transport-wide-cc packet was received.
|
void |
updateRemoteJitter(long remoteJitter)
Notifies this instance that an RTCP report with the given value for
RTP jitter was received.
|
void |
updateStats()
Computes and updates information for a specific stream.
|
public MediaStreamStatsImpl(MediaStreamImpl mediaStreamImpl)
mediaStreamImpl
- The MediaStreamImpl used to compute the stats.public static javax.media.control.JitterBufferControl getJitterBufferControl(javax.media.rtp.ReceiveStream receiveStream)
receiveStream
- the ReceiveStream to get the
JitterBufferControl ofpublic double getDownloadJitterMs()
getDownloadJitterMs
in interface MediaStreamStats
public long getDownloadNbPacketLost()
getDownloadNbPacketLost
in interface MediaStreamStats
public long getUploadNbPacketLost()
getUploadNbPacketLost
in interface MediaStreamStats
public double getDownloadPercentLoss()
getDownloadPercentLoss
in interface MediaStreamStats
public double getDownloadRateKiloBitPerSec()
getDownloadRateKiloBitPerSec
in interface MediaStreamStats
public java.awt.Dimension getDownloadVideoSize()
getDownloadVideoSize
in interface MediaStreamStats
public java.lang.String getEncoding()
getEncoding
in interface MediaStreamStats
public java.lang.String getEncodingClockRate()
getEncodingClockRate
in interface MediaStreamStats
public int getJitterBufferDelayMs()
getJitterBufferDelayMs
in interface MediaStreamStats
public int getJitterBufferDelayPackets()
getJitterBufferDelayPackets
in interface MediaStreamStats
public double getMinDownloadJitterMs()
getMinDownloadJitterMs
in interface MediaStreamStats
public double getMaxDownloadJitterMs()
getMaxDownloadJitterMs
in interface MediaStreamStats
public double getMinUploadJitterMs()
getMinUploadJitterMs
in interface MediaStreamStats
public double getMaxUploadJitterMs()
getMaxUploadJitterMs
in interface MediaStreamStats
public double getAvgDownloadJitterMs()
getAvgDownloadJitterMs
in interface MediaStreamStats
public double getAvgUploadJitterMs()
getAvgUploadJitterMs
in interface MediaStreamStats
public void updateRemoteJitter(long remoteJitter)
remoteJitter
- the jitter received, in RTP time units.public java.lang.String getLocalIPAddress()
getLocalIPAddress
in interface MediaStreamStats
public int getLocalPort()
getLocalPort
in interface MediaStreamStats
public long getNbDiscarded()
getNbDiscarded
in interface MediaStreamStats
public int getNbDiscardedFull()
getNbDiscardedFull
in interface MediaStreamStats
public int getNbDiscardedLate()
getNbDiscardedLate
in interface MediaStreamStats
public int getNbDiscardedReset()
getNbDiscardedReset
in interface MediaStreamStats
public int getNbDiscardedShrink()
getNbDiscardedShrink
in interface MediaStreamStats
public long getNbFec()
getNbFec
in interface MediaStreamStats
updateNbFec()
public long getNbPackets()
getNbPackets
in interface MediaStreamStats
public long getNbPacketsLost()
getNbPacketsLost
in interface MediaStreamStats
public long getNbPacketsSent()
getNbPacketsSent
in interface MediaStreamStats
public long getNbPacketsReceived()
getNbPacketsReceived
in interface MediaStreamStats
public long getNbReceivedBytes()
MediaStreamStats
getNbReceivedBytes
in interface MediaStreamStats
public long getNbSentBytes()
MediaStreamStats
getNbSentBytes
in interface MediaStreamStats
public int getPacketQueueCountPackets()
getPacketQueueCountPackets
in interface MediaStreamStats
public int getPacketQueueSize()
getPacketQueueSize
in interface MediaStreamStats
public double getPercentDiscarded()
getPercentDiscarded
in interface MediaStreamStats
public java.lang.String getRemoteIPAddress()
getRemoteIPAddress
in interface MediaStreamStats
public int getRemotePort()
getRemotePort
in interface MediaStreamStats
public RTCPReports getRTCPReports()
getRTCPReports
in interface MediaStreamStats
public long getRttMs()
getRttMs
in interface MediaStreamStats
public double getUploadJitterMs()
getUploadJitterMs
in interface MediaStreamStats
public double getUploadPercentLoss()
getUploadPercentLoss
in interface MediaStreamStats
public double getUploadRateKiloBitPerSec()
getUploadRateKiloBitPerSec
in interface MediaStreamStats
public java.awt.Dimension getUploadVideoSize()
getUploadVideoSize
in interface MediaStreamStats
public boolean isAdaptiveBufferEnabled()
MediaStreamStats
isAdaptiveBufferEnabled
in interface MediaStreamStats
public void updateStats()
updateStats
in interface MediaStreamStats
public void rembReceived(RTCPREMBPacket remb)
remb
- the packet.public void nackReceived(NACKPacket nack)
nack
- the packet.public void srReceived(net.sf.fmj.media.rtp.RTCPSRPacket sr)
sr
- the packet.public void addRTCPPacketListener(RTCPPacketListener listener)
addRTCPPacketListener
in interface MediaStreamStats
listener
- the listener.public void removeRTCPPacketListener(RTCPPacketListener listener)
removeRTCPPacketListener
in interface MediaStreamStats
listener
- the listener.public long getSendingBitrate()
MediaStreamStats.getUploadRateKiloBitPerSec()
. The duplication is necessary, because
of implementation details.
This method is different from getUploadRateKiloBitPerSec()
in
that:
1. It is not necessary for updateStats()
to be called
periodically by the user of libjitsi in order for it to return correct
values.
2. The returned value is based on the average bitrate over a fixed
window, as opposed to an EWMA.
3. The measurement is performed after the MediaStream
's
transformations, notably after simulcast layers are dropped (i.e. closer
to the network interface).
The return value includes RTP payload and RTP headers, as well as RTCP.getSendingBitrate
in interface MediaStreamStats
public void tccPacketReceived(RTCPTCCPacket tccPacket)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.