QueueAwareBitrateAdapter

class QueueAwareBitrateAdapter(maxBitrate: Int, minBitrate: Int, ceilingTtl: Int, listener: QueueAwareBitrateAdapter.Listener)

Alternative to BitrateAdapter driven by the send queue instead of by the measured bitrate.

BitrateAdapter probes upwards blindly and only reduces when the measured bitrate falls far enough below the configured one, so a link slightly slower than the target makes it oscillate above and below the real capacity. This one reads the queue: when frames start piling up the link is the limit, so it records the bitrate the link actually delivered and stays below it instead of climbing back to the maximum.

Feed it from onStreamingStats and apply Listener.onBitrateAdapted to the video encoder. maxBitrate is the whole wire budget, video plus audio, because that is what the report measures, so subtract the audio bitrate before applying it to video.

Constructors

Link copied to clipboard
constructor(maxBitrate: Int, minBitrate: Int, ceilingTtl: Int, listener: QueueAwareBitrateAdapter.Listener)
constructor(maxBitrate: Int, listener: QueueAwareBitrateAdapter.Listener)
constructor(maxBitrate: Int, minBitrate: Int, listener: QueueAwareBitrateAdapter.Listener)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface Listener

Functions

Link copied to clipboard
Link copied to clipboard
fun reset()