Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
a804ea36
提交
a804ea36
authored
4月 03, 2017
作者:
Iñaki Baz Castillo
提交者:
GitHub
4月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve NACK/PLI
* Improve some RTP logs. * Trigger PLI if RTP goes out of sync.
上级
d906109a
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
32 行增加
和
20 行删除
+32
-20
RtpStream.hpp
worker/include/RTC/RtpStream.hpp
+1
-1
RtpStream.cpp
worker/src/RTC/RtpStream.cpp
+15
-10
RtpStreamRecv.cpp
worker/src/RTC/RtpStreamRecv.cpp
+14
-3
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+2
-4
tests.cpp
worker/test/tests.cpp
+0
-2
没有找到文件。
worker/include/RTC/RtpStream.hpp
浏览文件 @
a804ea36
...
...
@@ -34,7 +34,7 @@ namespace RTC
private
:
void
InitSeq
(
uint16_t
seq
);
bool
UpdateSeq
(
uint16_t
seq
);
bool
UpdateSeq
(
RTC
::
RtpPacket
*
packet
);
/* Pure virtual methods that must be implemented by the subclass. */
protected
:
...
...
worker/src/RTC/RtpStream.cpp
浏览文件 @
a804ea36
...
...
@@ -35,19 +35,20 @@ namespace RTC
// If this is the first packet seen, initialize stuff.
if
(
!
this
->
started
)
{
this
->
started
=
true
;
InitSeq
(
seq
);
this
->
started
=
true
;
this
->
max_seq
=
seq
-
1
;
this
->
probation
=
MIN_SEQUENTIAL
;
}
// If not a valid packet ignore it.
if
(
!
UpdateSeq
(
seq
))
if
(
!
UpdateSeq
(
packet
))
{
if
(
!
this
->
probation
)
{
MS_WARN_TAG
(
rtp
,
"invalid packet [ssrc:%"
PRIu32
", seq:%"
PRIu16
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
());
MS_WARN_TAG
(
rtp
,
"invalid packet [ssrc:%"
PRIu32
", seq:%"
PRIu16
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
());
}
return
false
;
...
...
@@ -83,10 +84,11 @@ namespace RTC
onInitSeq
();
}
bool
RtpStream
::
UpdateSeq
(
uint16_t
seq
)
bool
RtpStream
::
UpdateSeq
(
RTC
::
RtpPacket
*
packet
)
{
MS_TRACE
();
uint16_t
seq
=
packet
->
GetSequenceNumber
();
uint16_t
udelta
=
seq
-
this
->
max_seq
;
/*
...
...
@@ -138,20 +140,23 @@ namespace RTC
* restarted without telling us so just re-sync
* (i.e., pretend this was the first packet).
*/
MS_WARN_TAG
(
rtp
,
"too bad sequence number, re-syncing RTP [ssrc:%"
PRIu32
", seq:%"
PRIu16
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
());
InitSeq
(
seq
);
}
else
{
MS_WARN_TAG
(
rtp
,
"bad sequence number, ignoring packet [ssrc:%"
PRIu32
", seq:%"
PRIu16
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
());
this
->
bad_seq
=
(
seq
+
1
)
&
(
RTP_SEQ_MOD
-
1
);
return
false
;
}
}
else
{
// Duplicate or reordered packet.
// NOTE: This would never happen because libsrtp rejects duplicated packets.
}
this
->
received
++
;
...
...
worker/src/RTC/RtpStreamRecv.cpp
浏览文件 @
a804ea36
...
...
@@ -148,6 +148,15 @@ namespace RTC
// Reset NackGenerator.
if
(
this
->
params
.
useNack
)
this
->
nackGenerator
.
reset
(
new
RTC
::
NackGenerator
(
this
));
// If we got out of sync, request a full frame.
if
(
this
->
started
&&
this
->
params
.
usePli
)
{
MS_DEBUG_TAG
(
rtx
,
"triggering PLI [ssrc:%"
PRIu32
"]"
,
this
->
params
.
ssrc
);
this
->
listener
->
onPliRequired
(
this
);
}
}
void
RtpStreamRecv
::
onNackRequired
(
const
std
::
vector
<
uint16_t
>&
seq_numbers
)
...
...
@@ -156,8 +165,8 @@ namespace RTC
MS_ASSERT
(
this
->
params
.
useNack
,
"NACK required but not supported"
);
MS_
DEBUG
_TAG
(
rtx
,
"
RTP retransmission required
[ssrc:%"
PRIu32
", first_seq:%"
PRIu16
", num_packets:%zu]"
,
MS_
WARN
_TAG
(
rtx
,
"
triggering NACK
[ssrc:%"
PRIu32
", first_seq:%"
PRIu16
", num_packets:%zu]"
,
this
->
params
.
ssrc
,
seq_numbers
[
0
],
seq_numbers
.
size
());
this
->
listener
->
onNackRequired
(
this
,
seq_numbers
);
...
...
@@ -170,10 +179,12 @@ namespace RTC
if
(
!
this
->
params
.
usePli
)
{
MS_WARN_TAG
(
rtx
,
"PLI required but not supported by the endpoint"
);
return
;
}
MS_DEBUG_TAG
(
rtx
,
"PLI triggered [ssrc:%"
PRIu32
"]"
,
this
->
params
.
ssrc
);
MS_DEBUG_TAG
(
rtx
,
"triggering PLI [ssrc:%"
PRIu32
"]"
,
this
->
params
.
ssrc
);
this
->
listener
->
onPliRequired
(
this
);
}
...
...
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
a804ea36
...
...
@@ -173,8 +173,6 @@ namespace RTC
uint8_t
bitmask_counter
=
0
;
bool
too_old_packet_found
=
false
;
MS_DEBUG_DEV
(
"loop [bitmask:"
MS_UINT16_TO_BINARY_PATTERN
"]"
,
MS_UINT16_TO_BINARY
(
bitmask
));
while
(
requested
||
bitmask
!=
0
)
{
bool
sent
=
false
;
...
...
@@ -196,7 +194,7 @@ namespace RTC
{
if
(
!
too_old_packet_found
)
{
MS_
DEBUG
_TAG
(
rtx
,
MS_
WARN
_TAG
(
rtx
,
"ignoring retransmission for too old packet [seq:%"
PRIu16
", max_age:%"
PRIu32
"ms, packet_age:%"
PRIu32
"ms]"
,
current_packet
->
GetSequenceNumber
(),
MAX_RETRANSMISSION_AGE
,
diff
);
...
...
@@ -213,7 +211,7 @@ namespace RTC
resent_at_time
&&
now
-
resent_at_time
<
static_cast
<
uint64_t
>
(
rtt
))
{
MS_
DEBUG
_TAG
(
rtx
,
MS_
WARN
_TAG
(
rtx
,
"ignoring retransmission for a packet already resent in the last RTT ms [seq:%"
PRIu16
", rtt:%"
PRIu32
"]"
,
current_packet
->
GetSequenceNumber
(),
rtt
);
...
...
worker/test/tests.cpp
浏览文件 @
a804ea36
...
...
@@ -15,8 +15,6 @@ static void destroy();
int
main
(
int
argc
,
char
*
argv
[])
{
Settings
::
configuration
.
logLevel
=
LogLevel
::
LOG_DEBUG
;
Settings
::
configuration
.
logTags
.
rtp
=
true
;
Settings
::
configuration
.
logTags
.
rtcp
=
true
;
std
::
string
loggerId
=
"tests"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论