Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
41c49ce8
提交
41c49ce8
authored
2月 08, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Just retransmit RTP packets if no older than 200ms.
上级
aceec5f2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
7 行删除
+20
-7
RtpStream.h
worker/include/RTC/RtpStream.h
+2
-1
RtpStream.cpp
worker/src/RTC/RtpStream.cpp
+18
-6
没有找到文件。
worker/include/RTC/RtpStream.h
浏览文件 @
41c49ce8
...
...
@@ -59,7 +59,8 @@ namespace RTC
uint32_t
received_prior
=
0
;
// Packet received at last interval.
uint32_t
transit
=
0
;
// Relative trans time for prev pkt.
uint32_t
jitter
=
0
;
// Estimated jitter.
// Others.
// RTP buffer.
uint32_t
max_timestamp
=
0
;
// Highest timestamp seen.
std
::
vector
<
StorageItem
>
storage
;
typedef
std
::
list
<
BufferItem
>
Buffer
;
Buffer
buffer
;
...
...
worker/src/RTC/RtpStream.cpp
浏览文件 @
41c49ce8
...
...
@@ -11,6 +11,7 @@
#define MAX_DROPOUT 3000
#define MAX_MISORDER 100
#define RTP_SEQ_MOD (1<<16)
#define MAX_RETRANSMISSION_AGE 200 // Don't retransmit packets older than this (ms).
namespace
RTC
{
...
...
@@ -55,13 +56,13 @@ namespace RTC
return
false
;
}
// Update highest timestamp seen.
if
(
packet
->
GetTimestamp
()
>
this
->
max_timestamp
)
this
->
max_timestamp
=
packet
->
GetTimestamp
();
// If bufferSize was given, store the packet into the buffer.
if
(
this
->
storage
.
size
()
>
0
)
{
StorePacket
(
packet
);
// TODO: TMP
// Dump();
}
// Calculate Jitter.
CalculateJitter
(
packet
->
GetTimestamp
());
...
...
@@ -132,8 +133,19 @@ namespace RTC
{
auto
current_packet
=
(
*
buffer_it
).
packet
;
// Store the packet in the container and then increment its index.
container
[
container_idx
++
]
=
current_packet
;
// Just provide the packet if no older than MAX_RETRANSMISSION_AGE ms.
uint16_t
diff
=
(
this
->
max_timestamp
-
current_packet
->
GetTimestamp
())
*
1000
/
this
->
clockRate
;
if
(
diff
<=
MAX_RETRANSMISSION_AGE
)
{
// Store the packet in the container and then increment its index.
container
[
container_idx
++
]
=
current_packet
;
}
else
{
MS_WARN_TAG
(
rtp
,
"ignoring retransmission for a packet older than %d ms"
,
MAX_RETRANSMISSION_AGE
);
}
// Exit the loop.
break
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论