Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
d0e6c9fe
提交
d0e6c9fe
authored
4月 04, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpStreamSend: just call to PacketRepaired() if sendTimes == 1
上级
baea9fad
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
25 行增加
和
28 行删除
+25
-28
RtpStreamSend.hpp
worker/include/RTC/RtpStreamSend.hpp
+8
-8
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+17
-20
没有找到文件。
worker/include/RTC/RtpStreamSend.hpp
浏览文件 @
d0e6c9fe
...
...
@@ -18,14 +18,7 @@ namespace RTC
RTC
::
RtpStreamSend
*
rtpStream
,
RTC
::
RtpPacket
*
packet
)
=
0
;
};
private
:
struct
StorageItem
{
// Allow some more space for RTX encoding.
uint8_t
store
[
RTC
::
MtuSize
+
200
];
};
private
:
public
:
struct
BufferItem
{
uint16_t
seq
{
0
};
// RTP seq.
...
...
@@ -35,6 +28,13 @@ namespace RTC
bool
rtxEncoded
{
false
};
// Whether the packet has already been RTX encoded.
};
private
:
struct
StorageItem
{
// Allow some more space for RTX encoding.
uint8_t
store
[
RTC
::
MtuSize
+
200
];
};
public
:
RtpStreamSend
(
RTC
::
RtpStreamSend
::
Listener
*
listener
,
RTC
::
RtpStream
::
Params
&
params
,
size_t
bufferSize
);
...
...
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
d0e6c9fe
...
...
@@ -13,7 +13,7 @@ namespace RTC
// 17: 16 bit mask + the initial sequence number.
static
constexpr
size_t
MaxRequestedPackets
{
17
};
static
std
::
vector
<
RTC
::
Rtp
Packet
*>
RetransmissionContainer
(
MaxRequestedPackets
+
1
);
static
std
::
vector
<
RTC
::
Rtp
StreamSend
::
BufferItem
*>
RetransmissionContainer
(
MaxRequestedPackets
+
1
);
// Don't retransmit packets older than this (ms).
static
constexpr
uint32_t
MaxRetransmissionDelay
{
2000
};
static
constexpr
uint32_t
DefaultRtt
{
100
};
...
...
@@ -80,17 +80,17 @@ namespace RTC
FillRetransmissionContainer
(
item
->
GetPacketId
(),
item
->
GetLostPacketBitmask
());
auto
it2
=
RetransmissionContainer
.
begin
();
for
(;
it2
!=
RetransmissionContainer
.
end
();
++
it2
)
for
(
auto
it2
=
RetransmissionContainer
.
begin
();
it2
!=
RetransmissionContainer
.
end
();
++
it2
)
{
// Note that this is an already RTX encoded packet if RTX is used
// (FillRetransmissionContainer() did it).
RTC
::
RtpPacket
*
packet
=
*
it2
;
auto
*
bufferItem
=
*
it2
;
if
(
packet
==
nullptr
)
if
(
bufferItem
==
nullptr
)
break
;
// Note that this is an already RTX encoded packet if RTX is used
// (FillRetransmissionContainer() did it).
auto
*
packet
=
bufferItem
->
packet
;
// Retransmit the packet.
static_cast
<
RTC
::
RtpStreamSend
::
Listener
*>
(
this
->
listener
)
->
OnRtpStreamRetransmitRtpPacket
(
this
,
packet
);
...
...
@@ -98,9 +98,9 @@ namespace RTC
// Mark the packet as retransmitted.
RTC
::
RtpStream
::
PacketRetransmitted
(
packet
);
// Mark the packet as repaired.
// TODO: Only if this is the first retransmission.
RTC
::
RtpStream
::
PacketRepaired
(
packet
);
// Mark the packet as repaired
(only if this is the first retransmission)
.
if
(
bufferItem
->
sentTimes
==
1
)
RTC
::
RtpStream
::
PacketRepaired
(
packet
);
}
}
}
...
...
@@ -331,13 +331,8 @@ namespace RTC
if
(
this
->
buffer
.
empty
())
return
;
uint16_t
firstSeq
=
seq
;
uint16_t
lastSeq
=
firstSeq
+
MaxRequestedPackets
-
1
;
// Number of requested packets cannot be greater than the container size - 1.
MS_ASSERT
(
RetransmissionContainer
.
size
()
-
1
>=
MaxRequestedPackets
,
"RtpPacket container is too small"
);
uint16_t
firstSeq
=
seq
;
uint16_t
lastSeq
=
firstSeq
+
MaxRequestedPackets
-
1
;
auto
bufferIt
=
this
->
buffer
.
begin
();
auto
bufferItReverse
=
this
->
buffer
.
rbegin
();
uint16_t
bufferFirstSeq
=
(
*
bufferIt
).
seq
;
...
...
@@ -438,11 +433,13 @@ namespace RTC
(
*
bufferIt
).
rtxEncoded
=
true
;
}
// Store the
packet
in the container and then increment its index.
RetransmissionContainer
[
containerIdx
++
]
=
currentPacket
;
// Store the
buffer item
in the container and then increment its index.
RetransmissionContainer
[
containerIdx
++
]
=
std
::
addressof
(
*
bufferIt
)
;
// Save when this packet was resent.
(
*
bufferIt
).
resentAtTime
=
now
;
// Increase the number of times this packet was sent.
(
*
bufferIt
).
sentTimes
++
;
sent
=
true
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论