Package org.webrtc
Class DynamicBitrateAdjuster
java.lang.Object
org.webrtc.BaseBitrateAdjuster
org.webrtc.DynamicBitrateAdjuster
- All Implemented Interfaces:
BitrateAdjuster
BitrateAdjuster that tracks the bandwidth produced by an encoder and dynamically adjusts the
bitrate. Used for hardware codecs that pay attention to framerate but still deviate from the
target bitrate by unacceptable margins.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final double
private static final double
private static final int
private int
private static final double
private double
private double
Fields inherited from class org.webrtc.BaseBitrateAdjuster
targetBitrateBps, targetFramerateFps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the current bitrate.private double
void
reportEncodedFrame
(int size) Should be used to report the size of an encoded frame to the bitrate adjuster.void
setTargets
(int targetBitrateBps, double targetFramerateFps) Sets the target bitrate in bits per second and framerate in frames per second.Methods inherited from class org.webrtc.BaseBitrateAdjuster
getAdjustedFramerateFps
-
Field Details
-
BITRATE_ADJUSTMENT_SEC
private static final double BITRATE_ADJUSTMENT_SEC- See Also:
-
BITRATE_ADJUSTMENT_MAX_SCALE
private static final double BITRATE_ADJUSTMENT_MAX_SCALE- See Also:
-
BITRATE_ADJUSTMENT_STEPS
private static final int BITRATE_ADJUSTMENT_STEPS- See Also:
-
BITS_PER_BYTE
private static final double BITS_PER_BYTE- See Also:
-
deviationBytes
private double deviationBytes -
timeSinceLastAdjustmentMs
private double timeSinceLastAdjustmentMs -
bitrateAdjustmentScaleExp
private int bitrateAdjustmentScaleExp
-
-
Constructor Details
-
DynamicBitrateAdjuster
DynamicBitrateAdjuster()
-
-
Method Details
-
setTargets
public void setTargets(int targetBitrateBps, double targetFramerateFps) Description copied from interface:BitrateAdjuster
Sets the target bitrate in bits per second and framerate in frames per second.- Specified by:
setTargets
in interfaceBitrateAdjuster
- Overrides:
setTargets
in classBaseBitrateAdjuster
-
reportEncodedFrame
public void reportEncodedFrame(int size) Description copied from interface:BitrateAdjuster
Should be used to report the size of an encoded frame to the bitrate adjuster. Use getAdjustedBitrateBps to get the updated bitrate after calling this method.- Specified by:
reportEncodedFrame
in interfaceBitrateAdjuster
- Overrides:
reportEncodedFrame
in classBaseBitrateAdjuster
-
getBitrateAdjustmentScale
private double getBitrateAdjustmentScale() -
getAdjustedBitrateBps
public int getAdjustedBitrateBps()Description copied from interface:BitrateAdjuster
Gets the current bitrate.- Specified by:
getAdjustedBitrateBps
in interfaceBitrateAdjuster
- Overrides:
getAdjustedBitrateBps
in classBaseBitrateAdjuster
-