Package org.jitsi.impl.neomedia.rtp
Class RTPEncodingDesc
- java.lang.Object
-
- org.jitsi.impl.neomedia.rtp.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 Summary
Fields Modifier and Type Field Description static intSUSPENDED_INDEXThe quality that is used to represent that forwarding is suspended.
-
Constructor Summary
Constructors Constructor Description RTPEncodingDesc(MediaStreamTrackDesc track, int idx, long primarySSRC, int tid, int sid, int height, double frameRate, RTPEncodingDesc[] dependencyEncodings)Ctor.RTPEncodingDesc(MediaStreamTrackDesc track, long primarySSRC)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSecondarySsrc(long ssrc, String type)RTPEncodingDescgetBaseLayer()Gets the rootRTPEncodingDescof the dependencies DAG.doublegetFrameRate()Gets the max frame rate (in fps) of the bitstream that this instance represents.intgetHeight()Gets the max height of the bitstream that this instance represents.intgetIndex()Gets the subjective quality index of this instance.longgetLastStableBitrateBps(long nowMs)Gets the last stable bitrate (in bps) for this instance.MediaStreamTrackDescgetMediaStreamTrack()Gets theMediaStreamTrackDescthat this instance belongs to.longgetPrimarySSRC()Gets the primary SSRC for this layering/encoding.longgetSecondarySsrc(String type)Get the secondary ssrc for this stream that corresponds to the given typebooleanisReceived()Gets the number of receivers for this encoding.booleanmatches(long ssrc)Gets a boolean indicating whether or not the SSRC specified in the arguments matches this encoding or not.booleanrequires(int idx)Returns a boolean that indicates whether or not thisRTPEncodingDescdepends on the subjective quality index that is passed as an argument.StringtoString()
-
-
-
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- theMediaStreamTrackDescthat 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- theMediaStreamTrackDescthat 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 encodingframeRate- the max frame rate (in fps) of this encodingdependencyEncodings- TheRTPEncodingDescon 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
-
getMediaStreamTrack
public MediaStreamTrackDesc getMediaStreamTrack()
Gets theMediaStreamTrackDescthat this instance belongs to.- Returns:
- the
MediaStreamTrackDescthat this instance belongs to.
-
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 thisRTPEncodingDescdepends 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
RTPEncodingDescdepends 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 rootRTPEncodingDescof the dependencies DAG. Useful for simulcast handling.- Returns:
- the root
RTPEncodingDescof 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.
-
-