add throttle config

This commit is contained in:
David Colburn
2021-06-21 17:13:58 -07:00
parent 46ad247927
commit eebc2f5acd
6 changed files with 103 additions and 50 deletions
+15
View File
@@ -2,6 +2,7 @@ package config
import (
"os"
"time"
"github.com/mitchellh/go-homedir"
"github.com/urfave/cli/v2"
@@ -37,6 +38,15 @@ type RTCConfig struct {
// Max bitrate for REMB
MaxBitrate uint64 `yaml:"max_bitrate"`
// Throttle periods for rtcp packets
Throttle RTCPThrottleConfig `yaml:"rtcp_throttle"`
}
type RTCPThrottleConfig struct {
LowQuality time.Duration `yaml:"low_quality"`
MidQuality time.Duration `yaml:"mid_quality"`
HighQuality time.Duration `yaml:"high_quality"`
}
type AudioConfig struct {
@@ -80,6 +90,11 @@ func NewConfig(confString string) (*Config, error) {
},
MaxBitrate: 3 * 1024 * 1024, // 3 mbps
PacketBufferSize: 500,
Throttle: RTCPThrottleConfig{
LowQuality: time.Second,
MidQuality: time.Second * 2,
HighQuality: time.Second * 3,
},
},
Audio: AudioConfig{
ActiveLevel: 40,