This commit is contained in:
KingKDot
2026-07-17 13:23:12 -05:00
parent 0219081682
commit 9a274811e8
16 changed files with 594 additions and 29 deletions
@@ -171,6 +171,14 @@ func handleWebrtcP2POffer(ctx context.Context, env *runtime.Env, cmdID string, p
OnClose: func() {
log.Printf("webrtc: P2P[%s/%s] session closed", kind, sessionID)
},
OnBandwidthEstimate: func(bps int) {
if kind != webrtcpub.KindDesktop {
return
}
if applied := capture.ApplyWebRTCBandwidthEstimate(bps); applied > 0 {
log.Printf("webrtc: P2P congestion target=%d Mbps applied=%d Mbps", bps/1_000_000, applied/1_000_000)
}
},
}
answerSDP, err := webrtcpub.StartP2POffer(ctx, kind, sessionID, offerSDP, callbacks, hasVideo, hasAudio)