Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
9dff0adb
提交
9dff0adb
authored
10月 20, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Worker tests: more work on RTCP
上级
baf362a4
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
57 行增加
和
40 行删除
+57
-40
SenderReport.hpp
worker/include/RTC/RTCP/SenderReport.hpp
+1
-1
TestReceiverReport.cpp
worker/test/RTC/RTCP/TestReceiverReport.cpp
+29
-11
TestSenderReport.cpp
worker/test/RTC/RTCP/TestSenderReport.cpp
+27
-28
没有找到文件。
worker/include/RTC/RTCP/SenderReport.hpp
浏览文件 @
9dff0adb
...
...
@@ -178,7 +178,7 @@ namespace RTC
inline
size_t
SenderReportPacket
::
GetCount
()
const
{
return
this
->
reports
.
size
()
;
return
0
;
}
inline
size_t
SenderReportPacket
::
GetSize
()
const
...
...
worker/test/RTC/RTCP/TestReceiverReport.cpp
浏览文件 @
9dff0adb
...
...
@@ -7,18 +7,13 @@ using namespace RTC::RTCP;
namespace
TestReceiverReport
{
// RTCP
Packet. Sender Report and Receiver Repor
t.
// RTCP
Receiver Report Packe
t.
// clang-format off
uint8_t
buffer
[]
=
{
0x81
,
0xc8
,
0x00
,
0x0c
,
// Type: 200 (Sender Report), Count: 1, Length: 12
0x5d
,
0x93
,
0x15
,
0x34
,
// SSRC: 0x5d931534
0xdd
,
0x3a
,
0xc1
,
0xb4
,
// NTP Sec: 3711615412
0x76
,
0x54
,
0x71
,
0x71
,
// NTP Frac: 1985245553
0x00
,
0x08
,
0xcf
,
0x00
,
// RTP timestamp: 577280
0x00
,
0x00
,
0x0e
,
0x18
,
// Packet count: 3608
0x00
,
0x08
,
0xcf
,
0x00
,
// Octed count: 577280
0x81
,
0xc9
,
0x00
,
0x07
,
// Type: 201 (Receiver Report), Count: 1, Length: 7
0x5d
,
0x93
,
0x15
,
0x34
,
// Sender SSRC: 0x5d931534
// Receiver Report
0x01
,
0x93
,
0x2d
,
0xb4
,
// SSRC. 0x01932db4
0x00
,
0x00
,
0x00
,
0x01
,
// Fraction lost: 0, Total lost: 1
...
...
@@ -30,7 +25,7 @@ namespace TestReceiverReport
// clang-format on
// Receiver Report buffer start point.
uint8_t
*
rrBuffer
=
buffer
+
sizeof
(
Packet
::
CommonHeader
)
+
sizeof
(
SenderReport
::
Header
)
;
uint8_t
*
rrBuffer
=
buffer
+
sizeof
(
Packet
::
CommonHeader
)
+
sizeof
(
uint32_t
)
/*Sender SSRC*/
;
uint32_t
ssrc
=
0x01932db4
;
uint8_t
fractionLost
=
0
;
...
...
@@ -56,7 +51,30 @@ using namespace TestReceiverReport;
SCENARIO
(
"RTCP RR parsing"
,
"[parser][rtcp][rr]"
)
{
SECTION
(
"parse ReceiverReport"
)
SECTION
(
"parse RR packet"
)
{
ReceiverReportPacket
*
packet
=
ReceiverReportPacket
::
Parse
(
buffer
,
sizeof
(
buffer
));
auto
*
report
=
*
(
packet
->
Begin
());
verify
(
report
);
SECTION
(
"serialize packet instance"
)
{
uint8_t
serialized
[
sizeof
(
buffer
)]
=
{
0
};
packet
->
Serialize
(
serialized
);
SECTION
(
"compare serialized packet with original buffer"
)
{
REQUIRE
(
std
::
memcmp
(
buffer
,
serialized
,
sizeof
(
buffer
))
==
0
);
}
}
delete
packet
;
}
SECTION
(
"parse RR"
)
{
ReceiverReport
*
report
=
ReceiverReport
::
Parse
(
rrBuffer
,
sizeof
(
ReceiverReport
::
Header
));
...
...
@@ -67,7 +85,7 @@ SCENARIO("RTCP RR parsing", "[parser][rtcp][rr]")
delete
report
;
}
SECTION
(
"create R
eceiverReport
"
)
SECTION
(
"create R
R
"
)
{
// Create local report and check content.
ReceiverReport
report1
;
...
...
worker/test/RTC/RTCP/TestSenderReport.cpp
浏览文件 @
9dff0adb
...
...
@@ -12,20 +12,13 @@ namespace TestSenderReport
// clang-format off
uint8_t
buffer
[]
=
{
0x8
1
,
0xc8
,
0x00
,
0x0c
,
// Type: 200 (Sender Report), Count: 1, Length: 12
0x8
0
,
0xc8
,
0x00
,
0x06
,
// Type: 200 (Sender Report), Count: 0, Length: 6
0x5d
,
0x93
,
0x15
,
0x34
,
// SSRC: 0x5d931534
0xdd
,
0x3a
,
0xc1
,
0xb4
,
// NTP Sec: 3711615412
0x76
,
0x54
,
0x71
,
0x71
,
// NTP Frac: 1985245553
0x00
,
0x08
,
0xcf
,
0x00
,
// RTP timestamp: 577280
0x00
,
0x00
,
0x0e
,
0x18
,
// Packet count: 3608
0x00
,
0x08
,
0xcf
,
0x00
,
// Octed count: 577280
// Receiver Report
0x01
,
0x93
,
0x2d
,
0xb4
,
// SSRC. 0x01932db4
0x00
,
0x00
,
0x00
,
0x01
,
// Fraction lost: 0, Total lost: 1
0x00
,
0x00
,
0x00
,
0x00
,
// Extended highest sequence number: 0
0x00
,
0x00
,
0x00
,
0x00
,
// Jitter: 0
0x00
,
0x00
,
0x00
,
0x00
,
// Last SR: 0
0x00
,
0x00
,
0x00
,
0x05
// DLSR: 0
0x00
,
0x08
,
0xcf
,
0x00
// Octet count: 577280
};
// clang-format on
...
...
@@ -55,7 +48,30 @@ using namespace TestSenderReport;
SCENARIO
(
"RTCP SR parsing"
,
"[parser][rtcp][sr]"
)
{
SECTION
(
"parse sender report"
)
SECTION
(
"parse SR packet"
)
{
SenderReportPacket
*
packet
=
SenderReportPacket
::
Parse
(
buffer
,
sizeof
(
buffer
));
auto
*
report
=
*
(
packet
->
Begin
());
verify
(
report
);
SECTION
(
"serialize packet instance"
)
{
uint8_t
serialized
[
sizeof
(
buffer
)]
=
{
0
};
packet
->
Serialize
(
serialized
);
SECTION
(
"compare serialized packet with original buffer"
)
{
REQUIRE
(
std
::
memcmp
(
buffer
,
serialized
,
sizeof
(
buffer
))
==
0
);
}
}
delete
packet
;
}
SECTION
(
"parse SR"
)
{
SenderReport
*
report
=
SenderReport
::
Parse
(
srBuffer
,
sizeof
(
SenderReport
::
Header
));
...
...
@@ -78,7 +94,7 @@ SCENARIO("RTCP SR parsing", "[parser][rtcp][sr]")
delete
report
;
}
SECTION
(
"create S
enderReport
"
)
SECTION
(
"create S
R
"
)
{
// Create local report and check content.
SenderReport
report1
;
...
...
@@ -99,21 +115,4 @@ SCENARIO("RTCP SR parsing", "[parser][rtcp][sr]")
verify
(
&
report2
);
}
}
SECTION
(
"parse Packet with SenderReport and ReceiverReport"
)
{
auto
packet
=
Packet
::
Parse
(
buffer
,
sizeof
(
buffer
));
REQUIRE
(
packet
);
REQUIRE
(
packet
->
GetType
()
==
Type
::
SR
);
auto
sr
=
dynamic_cast
<
SenderReportPacket
*>
(
packet
);
auto
it
=
sr
->
Begin
();
auto
report
=
*
it
;
verify
(
report
);
REQUIRE
(
packet
->
GetNext
());
REQUIRE
(
packet
->
GetNext
()
->
GetType
()
==
Type
::
RR
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论