Class RTPEncodingDesc


  • public class RTPEncodingDesc
    extends Object
    Keeps track of how many channels receive it, its subjective quality index, its last stable bitrate and other useful things for adaptivity/routing.
    Author:
    George Politis
    • Field Detail

      • SUSPENDED_INDEX

        public static final int SUSPENDED_INDEX
        The quality that is used to represent that forwarding is suspended.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RTPEncodingDesc

        public RTPEncodingDesc​(MediaStreamTrackDesc track,
                               long primarySSRC)
        Ctor.
        Parameters:
        track - the MediaStreamTrackDesc that this instance belongs to.
        primarySSRC - The primary SSRC for this layering/encoding.
      • RTPEncodingDesc

        public RTPEncodingDesc​(MediaStreamTrackDesc track,
                               int idx,
                               long primarySSRC,
                               int tid,
                               int sid,
                               int height,
                               double frameRate,
                               RTPEncodingDesc[] dependencyEncodings)
        Ctor.
        Parameters:
        track - the MediaStreamTrackDesc that this instance belongs to.
        idx - the subjective quality index for this layering/encoding.
        primarySSRC - The primary SSRC for this layering/encoding.
        tid - temporal layer ID for this layering/encoding.
        sid - spatial layer ID for this layering/encoding.
        height - the max height of this encoding
        frameRate - the max frame rate (in fps) of this encoding
        dependencyEncodings - The RTPEncodingDesc on which this layer depends.
    • Method Detail

      • addSecondarySsrc

        public void addSecondarySsrc​(long ssrc,
                                     String type)
      • getLastStableBitrateBps

        public long getLastStableBitrateBps​(long nowMs)
        Gets the last stable bitrate (in bps) for this instance.
        Returns:
        The last stable bitrate (in bps) for this instance.
      • getPrimarySSRC

        public long getPrimarySSRC()
        Gets the primary SSRC for this layering/encoding.
        Returns:
        the primary SSRC for this layering/encoding.
      • getSecondarySsrc

        public long getSecondarySsrc​(String type)
        Get the secondary ssrc for this stream that corresponds to the given type
        Parameters:
        type - the type of the secondary ssrc (e.g. RTX)
        Returns:
        the ssrc for the stream that corresponds to the given type, if it exists; otherwise -1
      • getIndex

        public int getIndex()
        Gets the subjective quality index of this instance.
        Returns:
        the subjective quality index of this instance.
      • requires

        public boolean requires​(int idx)
        Returns a boolean that indicates whether or not this RTPEncodingDesc depends on the subjective quality index that is passed as an argument.
        Parameters:
        idx - the index of this instance in the track encodings array.
        Returns:
        true if this RTPEncodingDesc depends on the subjective quality index that is passed as an argument, false otherwise.
      • matches

        public boolean matches​(long ssrc)
        Gets a boolean indicating whether or not the SSRC specified in the arguments matches this encoding or not.
        Parameters:
        ssrc - the SSRC to match.
      • getBaseLayer

        public RTPEncodingDesc getBaseLayer()
        Gets the root RTPEncodingDesc of the dependencies DAG. Useful for simulcast handling.
        Returns:
        the root RTPEncodingDesc of the dependencies DAG. Useful for simulcast handling.
      • getHeight

        public int getHeight()
        Gets the max height of the bitstream that this instance represents.
        Returns:
        the max height of the bitstream that this instance represents.
      • getFrameRate

        public double getFrameRate()
        Gets the max frame rate (in fps) of the bitstream that this instance represents.
        Returns:
        the max frame rate (in fps) of the bitstream that this instance represents.
      • isReceived

        public boolean isReceived()
        Gets the number of receivers for this encoding.
        Returns:
        the number of receivers for this encoding.