SrtBitrateRegulator

abstract class SrtBitrateRegulator(bitrateRegulatorConfig: BitrateRegulatorConfig, onVideoTargetBitrateChange: (Int) -> Unit, onAudioTargetBitrateChange: (Int) -> Unit) : BitrateRegulator

Base class of SRT bitrate regulation implementation.

If you want to implement your custom bitrate regulator, it must inherit from this class. The bitrate regulator object is created by streamers with the IBitrateRegulator.Factory.

Parameters

bitrateRegulatorConfig

bitrate regulation configuration

onVideoTargetBitrateChange

call when you have to change video bitrate

onAudioTargetBitrateChange

call when you have to change audio bitrate

Inheritors

Constructors

Link copied to clipboard
constructor(bitrateRegulatorConfig: BitrateRegulatorConfig, onVideoTargetBitrateChange: (Int) -> Unit, onAudioTargetBitrateChange: (Int) -> Unit)

Types

Link copied to clipboard

Factory interface you must use to create a SrtBitrateRegulator object. If you want to create a custom SRT bitrate regulation implementation, create a factory that implements this interface.

Properties

Link copied to clipboard
Link copied to clipboard
protected val onAudioTargetBitrateChange: (Int) -> Unit
Link copied to clipboard
protected val onVideoTargetBitrateChange: (Int) -> Unit

Functions

Link copied to clipboard
abstract fun update(stats: Stats, currentVideoBitrate: Int, currentAudioBitrate: Int)

Call regularly to get new SRT stats

open override fun update(stats: Any, currentVideoBitrate: Int, currentAudioBitrate: Int)