initialize bucket size by publish bitrates (#2763)

This commit is contained in:
cnderrauber
2024-06-06 14:31:20 +08:00
committed by GitHub
parent f1886ece42
commit 908baeb942
3 changed files with 20 additions and 7 deletions
+6 -1
View File
@@ -353,11 +353,16 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track *webrtc.Tra
t.SetSimulcast(true)
}
var bitrates int
if len(ti.Layers) > int(layer) {
bitrates = int(ti.Layers[layer].GetBitrate())
}
if t.IsSimulcast() {
t.MediaTrackReceiver.SetLayerSsrc(mime, track.RID(), uint32(track.SSRC()))
}
buff.Bind(receiver.GetParameters(), track.Codec().RTPCodecCapability)
buff.Bind(receiver.GetParameters(), track.Codec().RTPCodecCapability, bitrates)
// if subscriber request fps before fps calculated, update them after fps updated.
buff.OnFpsChanged(func() {