Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
ec8fc439
提交
ec8fc439
authored
12月 29, 2016
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RTP retransmission: First implementation of RtpStream::RequestRtpRetransmission().
上级
6c7ed48e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
75 行增加
和
7 行删除
+75
-7
Room.cpp
worker/src/RTC/Room.cpp
+2
-1
RtpReceiver.cpp
worker/src/RTC/RtpReceiver.cpp
+0
-4
RtpStream.cpp
worker/src/RTC/RtpStream.cpp
+73
-2
没有找到文件。
worker/src/RTC/Room.cpp
浏览文件 @
ec8fc439
...
@@ -61,7 +61,7 @@ namespace RTC
...
@@ -61,7 +61,7 @@ namespace RTC
roomId
(
roomId
),
roomId
(
roomId
),
listener
(
listener
),
listener
(
listener
),
notifier
(
notifier
),
notifier
(
notifier
),
rtpRetransmissionContainer
(
20
0
)
rtpRetransmissionContainer
(
20
1
)
// Can retransmit up to 200 RTP packets.
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -611,6 +611,7 @@ namespace RTC
...
@@ -611,6 +611,7 @@ namespace RTC
// and call rtpSender->RetransmitRtpPacket(packet)
// and call rtpSender->RetransmitRtpPacket(packet)
// - MUST NOT forward the NACK to the rtpReceiver
// - MUST NOT forward the NACK to the rtpReceiver
// If not NACK, just forwar it.
rtpReceiver
->
ReceiveRtcpReceiverReport
(
report
);
rtpReceiver
->
ReceiveRtcpReceiverReport
(
report
);
}
}
...
...
worker/src/RTC/RtpReceiver.cpp
浏览文件 @
ec8fc439
...
@@ -269,10 +269,6 @@ namespace RTC
...
@@ -269,10 +269,6 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// First of all, set the first element of the container to null so, in case
// no packet is inserted into it, the reader will know it.
container
[
0
]
=
nullptr
;
// Proxy the request to the RtpStream.
// Proxy the request to the RtpStream.
if
(
this
->
rtpStream
)
if
(
this
->
rtpStream
)
this
->
rtpStream
->
RequestRtpRetransmission
(
seq
,
count
,
container
);
this
->
rtpStream
->
RequestRtpRetransmission
(
seq
,
count
,
container
);
...
...
worker/src/RTC/RtpStream.cpp
浏览文件 @
ec8fc439
...
@@ -64,12 +64,83 @@ namespace RTC
...
@@ -64,12 +64,83 @@ namespace RTC
return
true
;
return
true
;
}
}
// This method looks for the requested RTP packets and inserts them into the
// given container (and set to null the next container position).
void
RtpStream
::
RequestRtpRetransmission
(
uint16_t
seq
,
uint16_t
count
,
std
::
vector
<
RTC
::
RtpPacket
*>&
container
)
void
RtpStream
::
RequestRtpRetransmission
(
uint16_t
seq
,
uint16_t
count
,
std
::
vector
<
RTC
::
RtpPacket
*>&
container
)
{
{
MS_TRACE
();
MS_TRACE
();
// TODO: This method must look for the requested RTP packets and insert them
// First of all, set the first element of the container to null so, in case
// into the given container, and set to null the next container position.
// no packet is inserted into it, the reader will know it.
container
[
0
]
=
nullptr
;
// If the buffer is empty, just return.
if
(
this
->
buffer
.
size
()
==
0
)
return
;
// Convert the given sequence numbers to 32 bits.
uint32_t
first_seq32
=
(
uint32_t
)
seq
+
this
->
cycles
;
uint32_t
last_seq32
=
first_seq32
+
(
uint32_t
)
count
-
1
;
size_t
container_idx
=
0
;
// Number of requested packets cannot be greater than the container size - 1
// (note: leave the last element be null). If so, remove the younger ones.
if
((
size_t
)
count
>
container
.
size
()
-
1
)
first_seq32
=
last_seq32
-
uint32_t
(
container
.
size
()
-
1
);
auto
buffer_it
=
this
->
buffer
.
begin
();
auto
buffer_it_r
=
this
->
buffer
.
rbegin
();
uint32_t
buffer_first_seq32
=
(
*
buffer_it
).
seq32
;
uint32_t
buffer_last_seq32
=
(
*
buffer_it_r
).
seq32
;
// Requested packet range not found.
if
(
first_seq32
>
buffer_last_seq32
||
last_seq32
<
buffer_first_seq32
)
{
// Let's try with sequence numbers in the previous 16 cycle.
if
(
this
->
cycles
>
0
)
{
first_seq32
-=
RTP_SEQ_MOD
;
last_seq32
-=
RTP_SEQ_MOD
;
// Try again.
if
(
first_seq32
>
buffer_last_seq32
||
last_seq32
<
buffer_first_seq32
)
return
;
}
// Otherwise just return.
else
{
return
;
}
}
// Filter non present packets.
if
(
first_seq32
<
buffer_first_seq32
)
first_seq32
=
buffer_first_seq32
;
if
(
last_seq32
>
buffer_last_seq32
)
last_seq32
=
buffer_last_seq32
;
// Look for each requested packet.
for
(
uint32_t
seq32
=
first_seq32
;
seq32
<=
last_seq32
;
seq32
++
)
{
for
(;
buffer_it
!=
this
->
buffer
.
end
();
buffer_it
++
)
{
auto
current_seq32
=
(
*
buffer_it
).
seq32
;
// Found.
if
(
current_seq32
==
seq32
)
{
auto
current_packet
=
(
*
buffer_it
).
packet
;
// Store the packet in the container and then increment its index.
container
[
container_idx
++
]
=
current_packet
;
// Exit the loop.
break
;
}
}
}
// Set the next container element to null.
container
[
container_idx
]
=
nullptr
;
}
}
void
RtpStream
::
InitSeq
(
uint16_t
seq
)
void
RtpStream
::
InitSeq
(
uint16_t
seq
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论