Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
7cc0d7ea
提交
7cc0d7ea
authored
2月 09, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NACK RTP retransmission: Log original bitmask and sent bitmask
上级
692cf60c
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
8 行删除
+19
-8
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+19
-8
没有找到文件。
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
7cc0d7ea
...
@@ -78,7 +78,6 @@ namespace RTC
...
@@ -78,7 +78,6 @@ namespace RTC
// Convert the given sequence numbers to 32 bits.
// Convert the given sequence numbers to 32 bits.
uint32_t
first_seq32
=
(
uint32_t
)
seq
+
this
->
cycles
;
uint32_t
first_seq32
=
(
uint32_t
)
seq
+
this
->
cycles
;
uint32_t
last_seq32
=
first_seq32
+
maxRequestedPackets
-
1
;
uint32_t
last_seq32
=
first_seq32
+
maxRequestedPackets
-
1
;
size_t
container_idx
=
0
;
// Number of requested packets cannot be greater than the container size - 1.
// Number of requested packets cannot be greater than the container size - 1.
MS_ASSERT
(
container
.
size
()
-
1
>=
maxRequestedPackets
,
"RtpPacket container is too small"
);
MS_ASSERT
(
container
.
size
()
-
1
>=
maxRequestedPackets
,
"RtpPacket container is too small"
);
...
@@ -104,7 +103,7 @@ namespace RTC
...
@@ -104,7 +103,7 @@ namespace RTC
// Otherwise just return.
// Otherwise just return.
else
else
{
{
MS_WARN_TAG
(
rtp
,
"requested range not in the buffer"
);
MS_WARN_TAG
(
rtp
,
"requested
packet
range not in the buffer"
);
return
;
return
;
}
}
...
@@ -113,12 +112,14 @@ namespace RTC
...
@@ -113,12 +112,14 @@ namespace RTC
// Look for each requested packet.
// Look for each requested packet.
uint32_t
seq32
=
first_seq32
;
uint32_t
seq32
=
first_seq32
;
bool
requested
=
true
;
bool
requested
=
true
;
size_t
container_idx
=
0
;
// Some variables for debugging.
// Some variables for debugging.
uint16_t
orig_bitmask
=
bitmask
;
uint16_t
orig_bitmask
=
bitmask
;
uint16_t
sent_bitmask
=
0
b0000000000000000
;
uint16_t
sent_bitmask
=
0
b0000000000000000
;
int8_t
bitmask_counter
=
-
1
;
int8_t
bitmask_counter
=
-
1
;
bool
first_packet_sent
=
false
;
bool
first_packet_sent
=
false
;
bool
too_old_packet_found
=
false
;
do
do
{
{
...
@@ -134,10 +135,9 @@ namespace RTC
...
@@ -134,10 +135,9 @@ namespace RTC
if
(
current_seq32
==
seq32
)
if
(
current_seq32
==
seq32
)
{
{
auto
current_packet
=
(
*
buffer_it
).
packet
;
auto
current_packet
=
(
*
buffer_it
).
packet
;
// Just provide the packet if no older than MAX_RETRANSMISSION_AGE ms.
uint32_t
diff
=
(
this
->
max_timestamp
-
current_packet
->
GetTimestamp
())
*
1000
/
this
->
clockRate
;
uint32_t
diff
=
(
this
->
max_timestamp
-
current_packet
->
GetTimestamp
())
*
1000
/
this
->
clockRate
;
// Just provide the packet if no older than MAX_RETRANSMISSION_AGE ms.
if
(
diff
<=
MAX_RETRANSMISSION_AGE
)
if
(
diff
<=
MAX_RETRANSMISSION_AGE
)
{
{
// Store the packet in the container and then increment its index.
// Store the packet in the container and then increment its index.
...
@@ -147,9 +147,11 @@ namespace RTC
...
@@ -147,9 +147,11 @@ namespace RTC
if
(
bitmask_counter
==
-
1
)
if
(
bitmask_counter
==
-
1
)
first_packet_sent
=
true
;
first_packet_sent
=
true
;
}
}
else
else
if
(
!
too_old_packet_found
)
{
{
MS_WARN_TAG
(
rtp
,
"ignoring retransmission for too old packet [max_age:%"
PRIu32
"ms, packet_age:%"
PRIu32
"ms]"
,
MAX_RETRANSMISSION_AGE
,
diff
);
MS_WARN_TAG
(
rtp
,
"ignoring retransmission for too old packet [max_age:%"
PRIu32
"ms, packet_age:%"
PRIu32
"ms]"
,
MAX_RETRANSMISSION_AGE
,
diff
);
too_old_packet_found
=
true
;
}
}
// Exit the loop.
// Exit the loop.
...
@@ -169,9 +171,18 @@ namespace RTC
...
@@ -169,9 +171,18 @@ namespace RTC
}
}
while
(
bitmask
!=
0
);
while
(
bitmask
!=
0
);
// TODO:
// If the first requested packet in the NACK was sent but not all the others,
MS_WARN_TAG
(
rtcp
,
"[first_packet_sent:%d, bitmask:"
UINT16_TO_BINARY_PATTERN
", sent: "
UINT16_TO_BINARY_PATTERN
"]"
,
// log it.
(
int
)
first_packet_sent
,
UINT16_TO_BINARY
(
orig_bitmask
),
UINT16_TO_BINARY
(
sent_bitmask
));
if
(
first_packet_sent
&&
orig_bitmask
!=
sent_bitmask
)
{
MS_WARN_TAG
(
rtcp
,
"first packet sent but bitmask not [bitmask:"
UINT16_TO_BINARY_PATTERN
", sent: "
UINT16_TO_BINARY_PATTERN
"]"
,
UINT16_TO_BINARY
(
orig_bitmask
),
UINT16_TO_BINARY
(
sent_bitmask
));
}
else
if
(
first_packet_sent
&&
orig_bitmask
&&
orig_bitmask
==
sent_bitmask
)
{
MS_WARN_TAG
(
rtcp
,
"first packet and bitmask sent [bitmask:"
UINT16_TO_BINARY_PATTERN
"]"
,
UINT16_TO_BINARY
(
orig_bitmask
));
}
// Set the next container element to null.
// Set the next container element to null.
container
[
container_idx
]
=
nullptr
;
container
[
container_idx
]
=
nullptr
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论