Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
00c61558
提交
00c61558
authored
5月 03, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
works fine
上级
d882dc28
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
42 行删除
+5
-42
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+4
-41
TestRtpStreamSend.cpp
worker/test/src/RTC/TestRtpStreamSend.cpp
+1
-1
没有找到文件。
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
00c61558
...
@@ -22,7 +22,8 @@ namespace RTC
...
@@ -22,7 +22,8 @@ namespace RTC
RtpStreamSend
::
RtpStreamSend
(
RtpStreamSend
::
RtpStreamSend
(
RTC
::
RtpStreamSend
::
Listener
*
listener
,
RTC
::
RtpStream
::
Params
&
params
,
size_t
bufferSize
)
RTC
::
RtpStreamSend
::
Listener
*
listener
,
RTC
::
RtpStream
::
Params
&
params
,
size_t
bufferSize
)
:
RTC
::
RtpStream
::
RtpStream
(
listener
,
params
,
10
),
buffer
(
bufferSize
>
0
?
65536
:
0
),
storage
(
bufferSize
)
:
RTC
::
RtpStream
::
RtpStream
(
listener
,
params
,
10
),
buffer
(
bufferSize
>
0
?
65536
:
0
),
storage
(
bufferSize
)
{
{
MS_TRACE
();
MS_TRACE
();
}
}
...
@@ -98,8 +99,6 @@ namespace RTC
...
@@ -98,8 +99,6 @@ namespace RTC
// (FillRetransmissionContainer() did it).
// (FillRetransmissionContainer() did it).
auto
*
packet
=
bufferItem
->
packet
;
auto
*
packet
=
bufferItem
->
packet
;
MS_ERROR
(
"----- RETRANSMITTING PACKET seq:%"
PRIu16
,
packet
->
GetSequenceNumber
());
// Retransmit the packet.
// Retransmit the packet.
static_cast
<
RTC
::
RtpStreamSend
::
Listener
*>
(
this
->
listener
)
static_cast
<
RTC
::
RtpStreamSend
::
Listener
*>
(
this
->
listener
)
->
OnRtpStreamRetransmitRtpPacket
(
this
,
packet
);
->
OnRtpStreamRetransmitRtpPacket
(
this
,
packet
);
...
@@ -240,8 +239,6 @@ namespace RTC
...
@@ -240,8 +239,6 @@ namespace RTC
if
(
bufferItem
.
packet
)
if
(
bufferItem
.
packet
)
{
{
MS_ERROR
(
"new bufferStartIdx: %"
PRIu16
,
seq
);
this
->
bufferStartIdx
=
seq
;
this
->
bufferStartIdx
=
seq
;
break
;
break
;
...
@@ -268,8 +265,6 @@ namespace RTC
...
@@ -268,8 +265,6 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_ERROR
(
"--begin-- seq:%"
PRIu16
,
packet
->
GetSequenceNumber
());
if
(
packet
->
GetSize
()
>
RTC
::
MtuSize
)
if
(
packet
->
GetSize
()
>
RTC
::
MtuSize
)
{
{
MS_WARN_TAG
(
MS_WARN_TAG
(
...
@@ -289,8 +284,6 @@ namespace RTC
...
@@ -289,8 +284,6 @@ namespace RTC
// Buffer is empty.
// Buffer is empty.
if
(
this
->
bufferSize
==
0
)
if
(
this
->
bufferSize
==
0
)
{
{
MS_ERROR
(
"--1-- seq:%"
PRIu16
", buffer empty, first item"
,
packet
->
GetSequenceNumber
());
// Take the first storage position.
// Take the first storage position.
store
=
this
->
storage
[
0
].
store
;
store
=
this
->
storage
[
0
].
store
;
...
@@ -301,16 +294,8 @@ namespace RTC
...
@@ -301,16 +294,8 @@ namespace RTC
// the new packet or just ignore it (if duplicated packet).
// the new packet or just ignore it (if duplicated packet).
else
if
(
bufferItem
.
packet
)
else
if
(
bufferItem
.
packet
)
{
{
MS_ERROR
(
"--2-- seq:%"
PRIu16
", bufferItem used"
,
packet
->
GetSequenceNumber
());
if
(
packet
->
GetTimestamp
()
==
bufferItem
.
packet
->
GetTimestamp
())
if
(
packet
->
GetTimestamp
()
==
bufferItem
.
packet
->
GetTimestamp
())
{
MS_ERROR
(
"--2.1-- seq:%"
PRIu16
", duplicated packet, ignore"
,
packet
->
GetSequenceNumber
());
return
;
return
;
}
MS_ERROR
(
"--2.2-- seq:%"
PRIu16
", replacing stored packet"
,
packet
->
GetSequenceNumber
());
// Reuse the store used by the buffer item.
// Reuse the store used by the buffer item.
store
=
const_cast
<
uint8_t
*>
(
bufferItem
.
packet
->
GetData
());
store
=
const_cast
<
uint8_t
*>
(
bufferItem
.
packet
->
GetData
());
...
@@ -326,8 +311,6 @@ namespace RTC
...
@@ -326,8 +311,6 @@ namespace RTC
// Buffer not yet full, add an entry.
// Buffer not yet full, add an entry.
else
if
(
this
->
bufferSize
<
this
->
storage
.
size
())
else
if
(
this
->
bufferSize
<
this
->
storage
.
size
())
{
{
MS_ERROR
(
"--3-- seq:%"
PRIu16
", buffer not full yet"
,
packet
->
GetSequenceNumber
());
// Take the next storage position.
// Take the next storage position.
store
=
this
->
storage
[
this
->
bufferSize
].
store
;
store
=
this
->
storage
[
this
->
bufferSize
].
store
;
...
@@ -336,8 +319,6 @@ namespace RTC
...
@@ -336,8 +319,6 @@ namespace RTC
// Buffer full, remove oldest entry and add new one.
// Buffer full, remove oldest entry and add new one.
else
else
{
{
MS_ERROR
(
"--4-- seq:%"
PRIu16
", buffer full, removing oldest entry"
,
packet
->
GetSequenceNumber
());
auto
&
firstBufferItem
=
this
->
buffer
[
this
->
bufferStartIdx
];
auto
&
firstBufferItem
=
this
->
buffer
[
this
->
bufferStartIdx
];
// Reuse the store used by the first buffer item.
// Reuse the store used by the first buffer item.
...
@@ -354,23 +335,6 @@ namespace RTC
...
@@ -354,23 +335,6 @@ namespace RTC
// corresponding buffer item.
// corresponding buffer item.
// Update the new buffer item so it points to the cloned packed.
// Update the new buffer item so it points to the cloned packed.
bufferItem
.
packet
=
packet
->
Clone
(
store
);
bufferItem
.
packet
=
packet
->
Clone
(
store
);
MS_ERROR
(
"--end-- seq:%"
PRIu16
,
packet
->
GetSequenceNumber
());
// TODO
MS_ERROR
(
"<BUFFER DUMP> bufferStartIdx:%"
PRIu16
", bufferSize:%zu"
,
this
->
bufferStartIdx
,
this
->
bufferSize
);
for
(
size_t
seq
{
0
};
seq
<
this
->
buffer
.
size
();
++
seq
)
{
auto
&
bufferItem
=
this
->
buffer
[
seq
];
if
(
bufferItem
.
packet
)
MS_ERROR
(
" - item buffer with packet: seq:%zu"
,
seq
);
}
MS_ERROR
(
"</BUFFER DUMP>"
);
}
}
// This method looks for the requested RTP packets and inserts them into the
// This method looks for the requested RTP packets and inserts them into the
...
@@ -399,7 +363,7 @@ namespace RTC
...
@@ -399,7 +363,7 @@ namespace RTC
bool
requested
{
true
};
bool
requested
{
true
};
size_t
containerIdx
{
0
};
size_t
containerIdx
{
0
};
//
Some v
ariables for debugging.
//
V
ariables for debugging.
uint16_t
origBitmask
=
bitmask
;
uint16_t
origBitmask
=
bitmask
;
uint16_t
sentBitmask
{
0
b0000000000000000
};
uint16_t
sentBitmask
{
0
b0000000000000000
};
bool
isFirstPacket
{
true
};
bool
isFirstPacket
{
true
};
...
@@ -469,8 +433,7 @@ namespace RTC
...
@@ -469,8 +433,7 @@ namespace RTC
// now.
// now.
if
(
HasRtx
()
&&
!
bufferItem
.
rtxEncoded
)
if
(
HasRtx
()
&&
!
bufferItem
.
rtxEncoded
)
{
{
packet
->
RtxEncode
(
packet
->
RtxEncode
(
this
->
params
.
rtxPayloadType
,
this
->
params
.
rtxSsrc
,
++
this
->
rtxSeq
);
this
->
params
.
rtxPayloadType
,
this
->
params
.
rtxSsrc
,
++
this
->
rtxSeq
);
bufferItem
.
rtxEncoded
=
true
;
bufferItem
.
rtxEncoded
=
true
;
}
}
...
...
worker/test/src/RTC/TestRtpStreamSend.cpp
浏览文件 @
00c61558
...
@@ -94,7 +94,7 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp]")
...
@@ -94,7 +94,7 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp]")
params
.
useNack
=
true
;
params
.
useNack
=
true
;
// Create a RtpStreamSend.
// Create a RtpStreamSend.
RtpStreamSend
*
stream
=
new
RtpStreamSend
(
&
testRtpStreamListener
,
params
,
5
);
RtpStreamSend
*
stream
=
new
RtpStreamSend
(
&
testRtpStreamListener
,
params
,
3
);
// Receive all the packets (some of them not in order and/or duplicated).
// Receive all the packets (some of them not in order and/or duplicated).
stream
->
ReceivePacket
(
packet1
);
stream
->
ReceivePacket
(
packet1
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论