WebRTC congestion control (#26)

* Add congestion control

* Improve stream matching, add manual stream selection, add metrics

* Use a ticker for bitrate estimation and make bandwidth drops switch to lower streams more aggressively

* Missing signal response, fix video auto bug

* Remove redundant mutex

* Bitrate history queue

* Get bitrate fn support h264 & float64

---------

Co-authored-by: Aleksandar Sukovic <aleksandar.sukovic@gmail.com>
This commit is contained in:
Miroslav Šedivý
2023-02-06 19:45:51 +01:00
committed by GitHub
parent e80ae8019e
commit 2364facd60
15 changed files with 738 additions and 222 deletions

View File

@ -25,8 +25,11 @@ type WebRTCPeer interface {
SetCandidate(candidate webrtc.ICECandidateInit) error
SetVideoBitrate(bitrate int) error
GetVideoId() string
SetVideoID(videoID string) error
GetVideoID() string
SetPaused(isPaused bool) error
SetVideoAuto(auto bool)
VideoAuto() bool
SendCursorPosition(x, y int) error
SendCursorImage(cur *CursorImage, img []byte) error
@ -40,6 +43,6 @@ type WebRTCManager interface {
ICEServers() []ICEServer
CreatePeer(session Session, bitrate int) (*webrtc.SessionDescription, error)
CreatePeer(session Session, bitrate int, videoAuto bool) (*webrtc.SessionDescription, error)
SetCursorPosition(x, y int)
}