当前位置 : 主页 > 大数据 > 区块链 >

webrtc – 候选冰中的组件ID

来源:互联网 收集:自由互联 发布时间:2021-06-22
典型的SDP消息 v=0o=- 3376022867449415700 2 IN IP4 127.0.0.1s=Doubango Telecom - chromet=0 0a=group:BUNDLE audio videoa=msid-semantic: WMS Jyup2XWPA5tOgvau9NIBMjlZFQzSEl6g3P0bm=audio 57008 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13
典型的SDP消息

v=0
o=- 3376022867449415700 2 IN IP4 127.0.0.1
s=Doubango Telecom - chrome
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS Jyup2XWPA5tOgvau9NIBMjlZFQzSEl6g3P0b
m=audio 57008 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 202.53.167.164
a=rtcp:57008 IN IP4 202.53.167.164
a=candidate:2068563606 1 udp 2122194687 192.168.10.148 57008 typ host  generation 0
a=candidate:2068563606 2 udp 2122194687 192.168.10.148 57008 typ host generation 0
a=candidate:902314598 1 tcp 1518214911 192.168.10.148 0 typ host tcptype active generation 0
a=candidate:902314598 2 tcp 1518214911 192.168.10.148 0 typ host tcptype active generation 0
a=candidate:3083270405 1 udp 1685987071 202.53.167.164 57008 typ srflx raddr 192.168.10.148 rport 57008 generation 0
a=candidate:3083270405 2 udp 1685987071 202.53.167.164 57008 typ srflx raddr 192.168.10.148 rport 57008 generation 0
a=ice-ufrag:cinBWZB6tiSnOnf1
a=ice-pwd:50yVBGm5WuKlbZeyRrmjOvMn
a=ice-options:google-ice
a=fingerprint:sha-256 7C:69:84:B5:D5:C1:86:D0:56:8F:22:BA:5F:61:AD:1E:55:21:5A:6A:50:35:0C:49:E2:43:E9:C0:03:CC:B5:31

任何候选优先级取决于参考RFC 5245的典型首选项,本地首选项和组件ID

对于RTP组件id为1,对于RTCP组件id为2

所以基于组件id,候选者的优先级被改变.

但是在上面的代码示例中,为什么优先级对于不同的组件id和相同类型的候选者是相同的.

引自 RFC5245

An agent SHOULD compute this priority using the formula in
Section 4.1.2.1

注意这个词应该是.让我们看看从RFC2119开始意味着什么

SHOULD This word, or the adjective “RECOMMENDED”, mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.

这意味着并非绝对必须精确地遵循算法来计算候选人的优先级.如果有必要,可以修改算法.我认为您提供的SDP就是这种情况.在计算优先级时,他们忽略了候选人的组件ID.

网友评论