From 8d006d97e4184890cfd4fe87727abb9e5bbdd56d Mon Sep 17 00:00:00 2001 From: Yohan Totting Date: Fri, 17 Nov 2023 14:55:50 +0700 Subject: [PATCH] fix typo on callbacks --- client.go | 5 +---- examples/http-websocket/main.go | 4 ++-- sfu.go | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/client.go b/client.go index 387fafa..429523b 100644 --- a/client.go +++ b/client.go @@ -215,7 +215,7 @@ func NewClient(s *SFU, id string, name string, peerConnectionConfig webrtc.Confi congestionController, err := cc.NewInterceptor(func() (cc.BandwidthEstimator, error) { // if bw below 100_000, somehow the estimator will struggle to probe the bandwidth and will stuck there. So we set the min to 100_000 // TODO: we need to use packet loss based bandwidth adjuster when the bandwidth is below 100_000 - return gcc.NewSendSideBWE(gcc.SendSideBWEInitialBitrate(int(s.bitratesConfig.InitialBandwidth)), gcc.SendSideBWEMinBitrate(100_000)) + return gcc.NewSendSideBWE(gcc.SendSideBWEInitialBitrate(int(s.bitratesConfig.InitialBandwidth))) }) if err != nil { panic(err) @@ -253,9 +253,6 @@ func NewClient(s *SFU, id string, name string, peerConnectionConfig webrtc.Confi panic(err) } - // add other clients tracks before generate the answer - // s.addOtherClientTracksBeforeSendAnswer(peerConnection) - var stateNew atomic.Value stateNew.Store(ClientStateNew) diff --git a/examples/http-websocket/main.go b/examples/http-websocket/main.go index 4c6d609..2a78084 100644 --- a/examples/http-websocket/main.go +++ b/examples/http-websocket/main.go @@ -65,8 +65,8 @@ func main() { defer cancel() sfuOpts := sfu.DefaultOptions() - sfuOpts.EnableMux = true - sfuOpts.EnableBandwidthEstimator = true + sfuOpts.EnableMux = false + sfuOpts.EnableBandwidthEstimator = false _, turnEnabled := os.LookupEnv("TURN_ENABLED") if turnEnabled { diff --git a/sfu.go b/sfu.go index a72bb1a..ac78a97 100644 --- a/sfu.go +++ b/sfu.go @@ -27,14 +27,14 @@ func DefaultBitrates() BitratesConfig { return BitratesConfig{ AudioRed: 48_000 * 3, Audio: 48_000, - Video: 1_500_000, - VideoHigh: 1_500_000, + Video: 1_200_000, + VideoHigh: 1_200_000, VideoHighPixels: 720, VideoMid: 500_000, VideoMidPixels: 360, VideoLow: 150_000, VideoLowPixels: 180, - InitialBandwidth: 1_500_000, + InitialBandwidth: 1_000_000, } } @@ -383,7 +383,7 @@ func (s *SFU) onClientAdded(client *Client) { } func (s *SFU) onClientRemoved(client *Client) { - for _, callback := range s.onClientAddedCallbacks { + for _, callback := range s.onClientRemovedCallbacks { callback(client) } }