Class StatisticsEngine

  • All Implemented Interfaces:
    PacketTransformer, TransformEngine

    public class StatisticsEngine
    extends SinglePacketTransformer
    implements TransformEngine
    Implements a TransformEngine monitors the incoming and outgoing RTCP packets, logs and stores statistical data about an associated MediaStream.
    Author:
    Damian Minkov, Lyubomir Marinov, Boris Grozev
    • Field Detail

      • RTP_STAT_PREFIX

        public static final String RTP_STAT_PREFIX
        The RTP statistics prefix we use for every log. Simplifies parsing and searching for statistics info in log files.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StatisticsEngine

        public StatisticsEngine​(MediaStreamImpl stream)
        Creates Statistic engine.
        Parameters:
        stream - the stream creating us.
    • Method Detail

      • getMaxInterArrivalJitter

        public long getMaxInterArrivalJitter()
        The minimum inter arrival jitter value we have reported.
        Returns:
        minimum inter arrival jitter value we have reported.
      • getAvgInterArrivalJitter

        public double getAvgInterArrivalJitter()
        Gets the average value of the jitter reported in RTCP packets, in RTP timestamp units.
      • getMinInterArrivalJitter

        public long getMinInterArrivalJitter()
        The maximum inter arrival jitter value we have reported.
        Returns:
        maximum inter arrival jitter value we have reported.
      • getRTCPTransformer

        public PacketTransformer getRTCPTransformer()
        Returns a reference to this class since it is performing RTP transformations in here.
        Specified by:
        getRTCPTransformer in interface TransformEngine
        Returns:
        a reference to this instance of the StatisticsEngine.
      • getRTPTransformer

        public PacketTransformer getRTPTransformer()
        Always returns null since this engine does not require any RTP transformations.
        Specified by:
        getRTPTransformer in interface TransformEngine
        Returns:
        null since this engine does not require any RTP transformations.
      • reverseTransform

        public RawPacket reverseTransform​(RawPacket pkt)
        Parses incoming RTCP packets and notifies the MediaStreamStats of this instance about the reception of packets with known types (currently these are RR, SR, XR, REMB, NACK).
        Specified by:
        reverseTransform in class SinglePacketTransformer
        Parameters:
        pkt - the packet to reverse-transform
        Returns:
        the packet which is the result of the reverse-transform
      • transform

        public RawPacket transform​(RawPacket pkt)
        Transfers RTCP sender report feedback as new information about the download stream for the MediaStreamStats. Finds the info needed for statistics in the packet and stores it, then returns the same packet as StatisticsEngine is not modifying it.
        Specified by:
        transform in class SinglePacketTransformer
        Parameters:
        pkt - the packet to transform
        Returns:
        the packet which is the result of the transform