Option to disable ICE-Lite to improve compatibility (#408)
This commit is contained in:
+12
-12
@@ -46,16 +46,14 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RTCConfig struct {
|
type RTCConfig struct {
|
||||||
UDPPort uint32 `yaml:"udp_port,omitempty"`
|
UDPPort uint32 `yaml:"udp_port,omitempty"`
|
||||||
TCPPort uint32 `yaml:"tcp_port,omitempty"`
|
TCPPort uint32 `yaml:"tcp_port,omitempty"`
|
||||||
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"`
|
UseExternalIP bool `yaml:"use_external_ip"`
|
||||||
StunServers []string `yaml:"stun_servers,omitempty"`
|
UseICELite bool `yaml:"use_ice_lite,omitempty"`
|
||||||
UseExternalIP bool `yaml:"use_external_ip"`
|
|
||||||
|
|
||||||
// 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
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user