Option to disable ICE-Lite to improve compatibility (#408)

This commit is contained in:
David Zhao
2022-02-05 22:57:47 -08:00
committed by GitHub
parent 4a9b844781
commit e6c236357a
5 changed files with 21 additions and 17 deletions
+12 -12
View File
@@ -46,16 +46,14 @@ type Config struct {
}
type RTCConfig struct {
UDPPort uint32 `yaml:"udp_port,omitempty"`
TCPPort uint32 `yaml:"tcp_port,omitempty"`
ICEPortRangeStart uint32 `yaml:"port_range_start,omitempty"`
ICEPortRangeEnd uint32 `yaml:"port_range_end,omitempty"`
NodeIP string `yaml:"node_ip,omitempty"`
// for testing, disable UDP
ForceTCP bool `yaml:"force_tcp,omitempty"`
StunServers []string `yaml:"stun_servers,omitempty"`
UseExternalIP bool `yaml:"use_external_ip"`
UDPPort uint32 `yaml:"udp_port,omitempty"`
TCPPort uint32 `yaml:"tcp_port,omitempty"`
ICEPortRangeStart uint32 `yaml:"port_range_start,omitempty"`
ICEPortRangeEnd uint32 `yaml:"port_range_end,omitempty"`
NodeIP string `yaml:"node_ip,omitempty"`
STUNServers []string `yaml:"stun_servers,omitempty"`
UseExternalIP bool `yaml:"use_external_ip"`
UseICELite bool `yaml:"use_ice_lite,omitempty"`
// Number of packets to buffer for NACK
PacketBufferSize int `yaml:"packet_buffer_size,omitempty"`
@@ -69,6 +67,8 @@ type RTCConfig struct {
UseSendSideBWE bool `yaml:"send_side_bandwidth_estimation,omitempty"`
CongestionControl CongestionControlConfig `yaml:"congestion_control,omitempty"`
// for testing, disable UDP
ForceTCP bool `yaml:"force_tcp,omitempty"`
}
type PLIThrottleConfig struct {
@@ -168,8 +168,8 @@ func NewConfig(confString string, c *cli.Context) (*Config, error) {
UDPPort: 0,
ICEPortRangeStart: 0,
ICEPortRangeEnd: 0,
StunServers: []string{},
MaxBitrate: 3 * 1024 * 1024, // 3 mbps
STUNServers: []string{},
MaxBitrate: 10 * 1024 * 1024, // 10 mbps
PacketBufferSize: 500,
PLIThrottle: PLIThrottleConfig{
LowQuality: 500 * time.Millisecond,
+1 -1
View File
@@ -12,7 +12,7 @@ import (
func (conf *Config) determineIP() (string, error) {
if conf.RTC.UseExternalIP {
stunServers := conf.RTC.StunServers
stunServers := conf.RTC.STUNServers
if len(stunServers) == 0 {
stunServers = DefaultStunServers
}
+4
View File
@@ -176,6 +176,10 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err
subscriberConfig.RTCPFeedback.Video = append(subscriberConfig.RTCPFeedback.Video, webrtc.RTCPFeedback{Type: webrtc.TypeRTCPFBGoogREMB})
}
if rtcConf.UseICELite {
s.SetLite(true)
}
return &WebRTCConfig{
Configuration: c,
SettingEngine: s,
+2 -2
View File
@@ -108,8 +108,8 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
//
se.DisableSRTPReplayProtection(true)
se.DisableSRTCPReplayProtection(true)
if params.ProtocolVersion.SupportsICELite() {
se.SetLite(true)
if !params.ProtocolVersion.SupportsICELite() {
se.SetLite(false)
}
lf := serverlogger.NewLoggerFactory(logr.Logger(params.Logger))
+2 -2
View File
@@ -515,9 +515,9 @@ func (r *RoomManager) iceServersForRoom(ri *livekit.Room) []*livekit.ICEServer {
}
}
if len(r.config.RTC.StunServers) > 0 {
if len(r.config.RTC.STUNServers) > 0 {
hasSTUN = true
iceServers = append(iceServers, iceServerForStunServers(r.config.RTC.StunServers))
iceServers = append(iceServers, iceServerForStunServers(r.config.RTC.STUNServers))
}
if !hasSTUN {