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
+6 -6
View File
@@ -51,11 +51,9 @@ type RTCConfig struct {
ICEPortRangeStart uint32 `yaml:"port_range_start,omitempty"` ICEPortRangeStart uint32 `yaml:"port_range_start,omitempty"`
ICEPortRangeEnd uint32 `yaml:"port_range_end,omitempty"` ICEPortRangeEnd uint32 `yaml:"port_range_end,omitempty"`
NodeIP string `yaml:"node_ip,omitempty"` NodeIP string `yaml:"node_ip,omitempty"`
// for testing, disable UDP STUNServers []string `yaml:"stun_servers,omitempty"`
ForceTCP bool `yaml:"force_tcp,omitempty"`
StunServers []string `yaml:"stun_servers,omitempty"`
UseExternalIP bool `yaml:"use_external_ip"` UseExternalIP bool `yaml:"use_external_ip"`
UseICELite bool `yaml:"use_ice_lite,omitempty"`
// Number of packets to buffer for NACK // Number of packets to buffer for NACK
PacketBufferSize int `yaml:"packet_buffer_size,omitempty"` PacketBufferSize int `yaml:"packet_buffer_size,omitempty"`
@@ -69,6 +67,8 @@ type RTCConfig struct {
UseSendSideBWE bool `yaml:"send_side_bandwidth_estimation,omitempty"` UseSendSideBWE bool `yaml:"send_side_bandwidth_estimation,omitempty"`
CongestionControl CongestionControlConfig `yaml:"congestion_control,omitempty"` CongestionControl CongestionControlConfig `yaml:"congestion_control,omitempty"`
// for testing, disable UDP
ForceTCP bool `yaml:"force_tcp,omitempty"`
} }
type PLIThrottleConfig struct { type PLIThrottleConfig struct {
@@ -168,8 +168,8 @@ func NewConfig(confString string, c *cli.Context) (*Config, error) {
UDPPort: 0, UDPPort: 0,
ICEPortRangeStart: 0, ICEPortRangeStart: 0,
ICEPortRangeEnd: 0, ICEPortRangeEnd: 0,
StunServers: []string{}, STUNServers: []string{},
MaxBitrate: 3 * 1024 * 1024, // 3 mbps MaxBitrate: 10 * 1024 * 1024, // 10 mbps
PacketBufferSize: 500, PacketBufferSize: 500,
PLIThrottle: PLIThrottleConfig{ PLIThrottle: PLIThrottleConfig{
LowQuality: 500 * time.Millisecond, LowQuality: 500 * time.Millisecond,
+1 -1
View File
@@ -12,7 +12,7 @@ import (
func (conf *Config) determineIP() (string, error) { func (conf *Config) determineIP() (string, error) {
if conf.RTC.UseExternalIP { if conf.RTC.UseExternalIP {
stunServers := conf.RTC.StunServers stunServers := conf.RTC.STUNServers
if len(stunServers) == 0 { if len(stunServers) == 0 {
stunServers = DefaultStunServers 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}) subscriberConfig.RTCPFeedback.Video = append(subscriberConfig.RTCPFeedback.Video, webrtc.RTCPFeedback{Type: webrtc.TypeRTCPFBGoogREMB})
} }
if rtcConf.UseICELite {
s.SetLite(true)
}
return &WebRTCConfig{ return &WebRTCConfig{
Configuration: c, Configuration: c,
SettingEngine: s, SettingEngine: s,
+2 -2
View File
@@ -108,8 +108,8 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
// //
se.DisableSRTPReplayProtection(true) se.DisableSRTPReplayProtection(true)
se.DisableSRTCPReplayProtection(true) se.DisableSRTCPReplayProtection(true)
if params.ProtocolVersion.SupportsICELite() { if !params.ProtocolVersion.SupportsICELite() {
se.SetLite(true) se.SetLite(false)
} }
lf := serverlogger.NewLoggerFactory(logr.Logger(params.Logger)) 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 hasSTUN = true
iceServers = append(iceServers, iceServerForStunServers(r.config.RTC.StunServers)) iceServers = append(iceServers, iceServerForStunServers(r.config.RTC.STUNServers))
} }
if !hasSTUN { if !hasSTUN {