add passive estimator & REMB back. (#35)

This commit is contained in:
Miroslav Šedivý 2023-03-13 17:55:52 +01:00 committed by GitHub
parent 0de8ffc773
commit 9936a04fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 11 deletions

View file

@ -28,6 +28,7 @@ type WebRTC struct {
IpRetrievalUrl string
EstimatorEnabled bool
EstimatorPassive bool
EstimatorInitialBitrate int
}
@ -79,6 +80,11 @@ func (WebRTC) Init(cmd *cobra.Command) error {
return err
}
cmd.PersistentFlags().Bool("webrtc.estimator.passive", false, "passive estimator mode, when it does not switch pipelines, only estimates")
if err := viper.BindPFlag("webrtc.estimator.passive", cmd.PersistentFlags().Lookup("webrtc.estimator.passive")); err != nil {
return err
}
cmd.PersistentFlags().Int("webrtc.estimator.initial_bitrate", 1_000_000, "initial bitrate for the bandwidth estimator")
if err := viper.BindPFlag("webrtc.estimator.initial_bitrate", cmd.PersistentFlags().Lookup("webrtc.estimator.initial_bitrate")); err != nil {
return err
@ -154,5 +160,6 @@ func (s *WebRTC) Set() {
// bandwidth estimator
s.EstimatorEnabled = viper.GetBool("webrtc.estimator.enabled")
s.EstimatorPassive = viper.GetBool("webrtc.estimator.passive")
s.EstimatorInitialBitrate = viper.GetInt("webrtc.estimator.initial_bitrate")
}