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
FieldsModifier and TypeFieldDescriptionprivate static final doubleprivate static final doubleprivate static final intprivate intprivate static final doubleprivate doubleprivate doubleFields inherited from class org.webrtc.BaseBitrateAdjuster
targetBitrateBps, targetFramerateFps -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the current bitrate.private doublevoidreportEncodedFrame(int size) Should be used to report the size of an encoded frame to the bitrate adjuster.voidsetTargets(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:BitrateAdjusterSets the target bitrate in bits per second and framerate in frames per second.- Specified by:
setTargetsin interfaceBitrateAdjuster- Overrides:
setTargetsin classBaseBitrateAdjuster
-
reportEncodedFrame
public void reportEncodedFrame(int size) Description copied from interface:BitrateAdjusterShould 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:
reportEncodedFramein interfaceBitrateAdjuster- Overrides:
reportEncodedFramein classBaseBitrateAdjuster
-
getBitrateAdjustmentScale
private double getBitrateAdjustmentScale() -
getAdjustedBitrateBps
public int getAdjustedBitrateBps()Description copied from interface:BitrateAdjusterGets the current bitrate.- Specified by:
getAdjustedBitrateBpsin interfaceBitrateAdjuster- Overrides:
getAdjustedBitrateBpsin classBaseBitrateAdjuster
-