Class RemoteBitrateEstimatorWrapper
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformer
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformerAdapter
-
- org.jitsi.impl.neomedia.rtp.remotebitrateestimator.RemoteBitrateEstimatorWrapper
-
- All Implemented Interfaces:
PacketTransformer,TransformEngine,CallStatsObserver,RemoteBitrateEstimator
public class RemoteBitrateEstimatorWrapper extends SinglePacketTransformerAdapter implements RemoteBitrateEstimator, TransformEngine
This is the receive-side remote bitrate estimator. If REMB support has not been signaled or if TCC support has been signaled, it's going to be disabled. If it's enabled, then if AST has been signaled it's going to use theRemoteBitrateEstimatorAbsSendTimeotherwise it's going to use theRemoteBitrateEstimatorSingleStream.- Author:
- George Politis
-
-
Field Summary
-
Fields inherited from interface org.jitsi.service.neomedia.rtp.RemoteBitrateEstimator
kBitrateScale, kBitrateWindowMs, kDefaultMinBitrateBps, kProcessIntervalMs, kStreamTimeOutMs, kTimestampGroupLengthMs
-
-
Constructor Summary
Constructors Constructor Description RemoteBitrateEstimatorWrapper(RemoteBitrateObserver observer, @NotNull org.jitsi.utils.logging.DiagnosticContext diagnosticContext)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetLatestEstimate()Returns the estimated payload bitrate in bits per second if a valid estimate exists; otherwise, -1.PacketTransformergetRTCPTransformer()Gets the PacketTransformer for RTCP packets.PacketTransformergetRTPTransformer()Gets the PacketTransformer for RTP packets.Collection<Long>getSsrcs()Returns the estimated payload bitrate in bits per second if a valid estimate exists; otherwise, -1.voidincomingPacketInfo(long arrivalTimeMs, long timestamp, int payloadSize, long ssrc)Notifies this instance of an incoming packet.voidonRttUpdate(long avgRttMs, long maxRttMs)booleanreceiveSideBweEnabled()Gets a boolean that indicates whether or not to perform receive-side bandwidth estimations.voidremoveStream(long ssrc)Removes all data for ssrc.RawPacketreverseTransform(RawPacket pkt)Reverse-transforms a specific packet.voidsetAstExtensionID(int astExtensionID)Sets the ID of the abs-send-time RTP extension.voidsetMinBitrate(int minBitrateBps)Sets the minimum bitrate for this instance.voidsetSupportsRemb(boolean supportsRemb)Sets the value of the flag which indicates whether the remote end supports RTCP REMB or not.voidsetTccExtensionID(int tccExtensionID)Sets the ID of the transport-cc RTP extension.-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformerAdapter
transform
-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformer
close, reverseTransform, transform
-
-
-
-
Constructor Detail
-
RemoteBitrateEstimatorWrapper
public RemoteBitrateEstimatorWrapper(RemoteBitrateObserver observer, @NotNull @NotNull org.jitsi.utils.logging.DiagnosticContext diagnosticContext)
Ctor.- Parameters:
observer- the observer to notify on bitrate estimation changes.diagnosticContext- theDiagnosticContextto be used by this instance.
-
-
Method Detail
-
getLatestEstimate
public long getLatestEstimate()
Returns the estimated payload bitrate in bits per second if a valid estimate exists; otherwise, -1.- Specified by:
getLatestEstimatein interfaceRemoteBitrateEstimator- Returns:
- the estimated payload bitrate in bits per seconds if a valid estimate exists; otherwise, -1
-
getSsrcs
public Collection<Long> getSsrcs()
Returns the estimated payload bitrate in bits per second if a valid estimate exists; otherwise, -1.- Specified by:
getSsrcsin interfaceRemoteBitrateEstimator- Returns:
- the estimated payload bitrate in bits per seconds if a valid estimate exists; otherwise, -1
-
removeStream
public void removeStream(long ssrc)
Removes all data for ssrc.- Specified by:
removeStreamin interfaceRemoteBitrateEstimator
-
setMinBitrate
public void setMinBitrate(int minBitrateBps)
Sets the minimum bitrate for this instance.- Specified by:
setMinBitratein interfaceRemoteBitrateEstimator- Parameters:
minBitrateBps- the minimum bitrate in bps.
-
incomingPacketInfo
public void incomingPacketInfo(long arrivalTimeMs, long timestamp, int payloadSize, long ssrc)Notifies this instance of an incoming packet.- Specified by:
incomingPacketInfoin interfaceRemoteBitrateEstimator- Parameters:
arrivalTimeMs- the arrival time of the packet in millis.timestamp- the 32bit send timestamp of the packet. Note that the specific format depends on the specific implementation.payloadSize- the payload size of the packet.ssrc- the SSRC of the packet.
-
reverseTransform
public RawPacket reverseTransform(RawPacket pkt)
Reverse-transforms a specific packet.- Overrides:
reverseTransformin classSinglePacketTransformerAdapter- Parameters:
pkt- the transformed packet to be restored.- Returns:
- the restored packet.
-
onRttUpdate
public void onRttUpdate(long avgRttMs, long maxRttMs)- Specified by:
onRttUpdatein interfaceCallStatsObserver
-
getRTPTransformer
public PacketTransformer getRTPTransformer()
Gets the PacketTransformer for RTP packets.- Specified by:
getRTPTransformerin interfaceTransformEngine- Returns:
- the PacketTransformer for RTP packets
-
getRTCPTransformer
public PacketTransformer getRTCPTransformer()
Gets the PacketTransformer for RTCP packets.- Specified by:
getRTCPTransformerin interfaceTransformEngine- Returns:
- the PacketTransformer for RTCP packets
-
setAstExtensionID
public void setAstExtensionID(int astExtensionID)
Sets the ID of the abs-send-time RTP extension. Set to -1 to effectively disable the AST remote bitrate estimator.- Parameters:
astExtensionID- the ID to set.
-
receiveSideBweEnabled
public boolean receiveSideBweEnabled()
Gets a boolean that indicates whether or not to perform receive-side bandwidth estimations.- Returns:
- true if receive-side bandwidth estimations are enabled, false otherwise.
-
setSupportsRemb
public void setSupportsRemb(boolean supportsRemb)
Sets the value of the flag which indicates whether the remote end supports RTCP REMB or not.- Parameters:
supportsRemb- the value to set.
-
setTccExtensionID
public void setTccExtensionID(int tccExtensionID)
Sets the ID of the transport-cc RTP extension. Anything other than -1 disables receive-side bandwidth estimations.- Parameters:
tccExtensionID- the ID to set.
-
-