forked from livekit/livekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol_version.go
55 lines (42 loc) · 1.31 KB
/
protocol_version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package types
type ProtocolVersion int
const CurrentProtocol = 8
func (v ProtocolVersion) SupportsPackedStreamId() bool {
return v > 0
}
func (v ProtocolVersion) SupportsProtobuf() bool {
return v > 0
}
func (v ProtocolVersion) HandlesDataPackets() bool {
return v > 1
}
// SubscriberAsPrimary indicates clients initiate subscriber connection as primary
func (v ProtocolVersion) SubscriberAsPrimary() bool {
return v > 2
}
// SupportsSpeakerChanged - if client handles speaker info deltas, instead of a comprehensive list
func (v ProtocolVersion) SupportsSpeakerChanged() bool {
return v > 2
}
// SupportsTransceiverReuse - if transceiver reuse is supported, optimizes SDP size
func (v ProtocolVersion) SupportsTransceiverReuse() bool {
return v > 3
}
// SupportsConnectionQuality - avoid sending frequent ConnectionQuality updates for lower protocol versions
func (v ProtocolVersion) SupportsConnectionQuality() bool {
return v > 4
}
func (v ProtocolVersion) SupportsSessionMigrate() bool {
return v > 5
}
func (v ProtocolVersion) SupportsICELite() bool {
return v > 5
}
func (v ProtocolVersion) SupportsUnpublish() bool {
return v > 6
}
// SupportFastStart - if client supports fast start, server side will send media streams
// in the first offer
func (v ProtocolVersion) SupportFastStart() bool {
return v > 7
}