Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
e952f34f
Unverified
提交
e952f34f
authored
11月 22, 2023
作者:
Iñaki Baz Castillo
提交者:
GitHub
11月 22, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RTCP `CompoundPacket`: Use a single DLRR block to hold all ssrc infos (#1237)
上级
1ed3a247
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
68 行增加
和
70 行删除
+68
-70
CHANGELOG.md
CHANGELOG.md
+1
-0
CompoundPacket.hpp
worker/include/RTC/RTCP/CompoundPacket.hpp
+13
-4
XrDelaySinceLastRr.hpp
worker/include/RTC/RTCP/XrDelaySinceLastRr.hpp
+13
-0
RtpStreamSend.hpp
worker/include/RTC/RtpStreamSend.hpp
+1
-1
PipeConsumer.cpp
worker/src/RTC/PipeConsumer.cpp
+5
-8
CompoundPacket.cpp
worker/src/RTC/RTCP/CompoundPacket.cpp
+28
-26
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+1
-1
SimpleConsumer.cpp
worker/src/RTC/SimpleConsumer.cpp
+2
-10
SimulcastConsumer.cpp
worker/src/RTC/SimulcastConsumer.cpp
+2
-10
SvcConsumer.cpp
worker/src/RTC/SvcConsumer.cpp
+2
-10
没有找到文件。
CHANGELOG.md
浏览文件 @
e952f34f
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
### NEXT
### NEXT
*
Fix RTCP SDES packet size calculation (
[
PR #1236
](
https://github.com/versatica/mediasoup/pull/1236
)
based on PR
[
PR #1234
](
https://github.com/versatica/mediasoup/pull/1234
)
by @ybybwdwd).
*
Fix RTCP SDES packet size calculation (
[
PR #1236
](
https://github.com/versatica/mediasoup/pull/1236
)
based on PR
[
PR #1234
](
https://github.com/versatica/mediasoup/pull/1234
)
by @ybybwdwd).
*
RTCP Compound Packet: Use a single DLRR report to hold all ssrc info sub-blocks (
[
PR #1237
](
https://github.com/versatica/mediasoup/pull/1237
)
).
### 3.13.4
### 3.13.4
...
...
worker/include/RTC/RTCP/CompoundPacket.hpp
浏览文件 @
e952f34f
...
@@ -48,14 +48,16 @@ namespace RTC
...
@@ -48,14 +48,16 @@ namespace RTC
// Adds the given data and returns true if there is enough space to hold it,
// Adds the given data and returns true if there is enough space to hold it,
// false otherwise.
// false otherwise.
bool
Add
(
bool
Add
(
SenderReport
*
senderReport
,
SdesChunk
*
sdesChunk
,
DelaySinceLastRr
*
delaySinceLastRrReport
);
SenderReport
*
senderReport
,
SdesChunk
*
sdesChunk
,
DelaySinceLastRr
::
SsrcInfo
*
delaySinceLastRrSsrcInfo
);
// RTCP additions per Consumer (pipe).
// RTCP additions per Consumer (pipe).
// Adds the given data and returns true if there is enough space to hold it,
// Adds the given data and returns true if there is enough space to hold it,
// false otherwise.
// false otherwise.
bool
Add
(
bool
Add
(
std
::
vector
<
SenderReport
*>&
senderReports
,
std
::
vector
<
SenderReport
*>&
senderReports
,
std
::
vector
<
SdesChunk
*>&
sdesChunks
,
std
::
vector
<
SdesChunk
*>&
sdesChunks
,
std
::
vector
<
DelaySinceLastRr
*>&
delaySinceLastRrReport
s
);
std
::
vector
<
DelaySinceLastRr
::
SsrcInfo
*>&
delaySinceLastRrSsrcInfo
s
);
// RTCP additions per Producer.
// RTCP additions per Producer.
// Adds the given data and returns true if there is enough space to hold it,
// Adds the given data and returns true if there is enough space to hold it,
// false otherwise.
// false otherwise.
...
@@ -63,8 +65,6 @@ namespace RTC
...
@@ -63,8 +65,6 @@ namespace RTC
void
AddSenderReport
(
SenderReport
*
report
);
void
AddSenderReport
(
SenderReport
*
report
);
void
AddReceiverReport
(
ReceiverReport
*
report
);
void
AddReceiverReport
(
ReceiverReport
*
report
);
void
AddSdesChunk
(
SdesChunk
*
chunk
);
void
AddSdesChunk
(
SdesChunk
*
chunk
);
void
AddReceiverReferenceTime
(
ReceiverReferenceTime
*
report
);
void
AddDelaySinceLastRr
(
DelaySinceLastRr
*
report
);
bool
HasSenderReport
()
bool
HasSenderReport
()
{
{
return
this
->
senderReportPacket
.
Begin
()
!=
this
->
senderReportPacket
.
End
();
return
this
->
senderReportPacket
.
Begin
()
!=
this
->
senderReportPacket
.
End
();
...
@@ -77,6 +77,14 @@ namespace RTC
...
@@ -77,6 +77,14 @@ namespace RTC
[](
const
ExtendedReportBlock
*
report
)
[](
const
ExtendedReportBlock
*
report
)
{
return
report
->
GetType
()
==
ExtendedReportBlock
::
Type
::
RRT
;
});
{
return
report
->
GetType
()
==
ExtendedReportBlock
::
Type
::
RRT
;
});
}
}
bool
HasDelaySinceLastRr
()
{
return
std
::
any_of
(
this
->
xrPacket
.
Begin
(),
this
->
xrPacket
.
End
(),
[](
const
ExtendedReportBlock
*
report
)
{
return
report
->
GetType
()
==
ExtendedReportBlock
::
Type
::
DLRR
;
});
}
void
Serialize
(
uint8_t
*
data
);
void
Serialize
(
uint8_t
*
data
);
private
:
private
:
...
@@ -85,6 +93,7 @@ namespace RTC
...
@@ -85,6 +93,7 @@ namespace RTC
ReceiverReportPacket
receiverReportPacket
;
ReceiverReportPacket
receiverReportPacket
;
SdesPacket
sdesPacket
;
SdesPacket
sdesPacket
;
ExtendedReportPacket
xrPacket
;
ExtendedReportPacket
xrPacket
;
DelaySinceLastRr
*
delaySinceLastRr
{
nullptr
};
};
};
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
...
...
worker/include/RTC/RTCP/XrDelaySinceLastRr.hpp
浏览文件 @
e952f34f
...
@@ -119,6 +119,19 @@ namespace RTC
...
@@ -119,6 +119,19 @@ namespace RTC
{
{
this
->
ssrcInfos
.
push_back
(
ssrcInfo
);
this
->
ssrcInfos
.
push_back
(
ssrcInfo
);
}
}
// NOTE: This method not only removes given number of ssrc info sub-blocks
// but also deletes their SsrcInfo instances.
void
RemoveLastSsrcInfos
(
size_t
number
)
{
while
(
!
this
->
ssrcInfos
.
empty
()
&&
number
--
>
0
)
{
auto
*
ssrcInfo
=
this
->
ssrcInfos
.
back
();
this
->
ssrcInfos
.
pop_back
();
delete
ssrcInfo
;
}
}
Iterator
Begin
()
Iterator
Begin
()
{
{
return
this
->
ssrcInfos
.
begin
();
return
this
->
ssrcInfos
.
begin
();
...
...
worker/include/RTC/RtpStreamSend.hpp
浏览文件 @
e952f34f
...
@@ -37,7 +37,7 @@ namespace RTC
...
@@ -37,7 +37,7 @@ namespace RTC
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
void
ReceiveRtcpXrReceiverReferenceTime
(
RTC
::
RTCP
::
ReceiverReferenceTime
*
report
);
void
ReceiveRtcpXrReceiverReferenceTime
(
RTC
::
RTCP
::
ReceiverReferenceTime
*
report
);
RTC
::
RTCP
::
SenderReport
*
GetRtcpSenderReport
(
uint64_t
nowMs
);
RTC
::
RTCP
::
SenderReport
*
GetRtcpSenderReport
(
uint64_t
nowMs
);
RTC
::
RTCP
::
DelaySinceLastRr
::
SsrcInfo
*
GetRtcpXrDelaySinceLastRr
(
uint64_t
nowMs
);
RTC
::
RTCP
::
DelaySinceLastRr
::
SsrcInfo
*
GetRtcpXrDelaySinceLastRr
SsrcInfo
(
uint64_t
nowMs
);
RTC
::
RTCP
::
SdesChunk
*
GetRtcpSdesChunk
();
RTC
::
RTCP
::
SdesChunk
*
GetRtcpSdesChunk
();
void
Pause
()
override
;
void
Pause
()
override
;
void
Resume
()
override
;
void
Resume
()
override
;
...
...
worker/src/RTC/PipeConsumer.cpp
浏览文件 @
e952f34f
...
@@ -345,7 +345,7 @@ namespace RTC
...
@@ -345,7 +345,7 @@ namespace RTC
std
::
vector
<
RTCP
::
SenderReport
*>
senderReports
;
std
::
vector
<
RTCP
::
SenderReport
*>
senderReports
;
std
::
vector
<
RTCP
::
SdesChunk
*>
sdesChunks
;
std
::
vector
<
RTCP
::
SdesChunk
*>
sdesChunks
;
std
::
vector
<
RTCP
::
DelaySinceLastRr
*>
xrReport
s
;
std
::
vector
<
RTCP
::
DelaySinceLastRr
::
SsrcInfo
*>
delaySinceLastRrSsrcInfo
s
;
for
(
auto
*
rtpStream
:
this
->
rtpStreams
)
for
(
auto
*
rtpStream
:
this
->
rtpStreams
)
{
{
...
@@ -362,19 +362,16 @@ namespace RTC
...
@@ -362,19 +362,16 @@ namespace RTC
auto
*
sdesChunk
=
rtpStream
->
GetRtcpSdesChunk
();
auto
*
sdesChunk
=
rtpStream
->
GetRtcpSdesChunk
();
sdesChunks
.
push_back
(
sdesChunk
);
sdesChunks
.
push_back
(
sdesChunk
);
auto
*
d
lrr
=
rtpStream
->
GetRtcpXrDelaySinceLastRr
(
nowMs
);
auto
*
d
elaySinceLastRrSsrcInfo
=
rtpStream
->
GetRtcpXrDelaySinceLastRrSsrcInfo
(
nowMs
);
if
(
d
lrr
)
if
(
d
elaySinceLastRrSsrcInfo
)
{
{
auto
*
report
=
new
RTC
::
RTCP
::
DelaySinceLastRr
();
delaySinceLastRrSsrcInfos
.
push_back
(
delaySinceLastRrSsrcInfo
);
report
->
AddSsrcInfo
(
dlrr
);
xrReports
.
push_back
(
report
);
}
}
}
}
// RTCP Compound packet buffer cannot hold the data.
// RTCP Compound packet buffer cannot hold the data.
if
(
!
packet
->
Add
(
senderReports
,
sdesChunks
,
xrReport
s
))
if
(
!
packet
->
Add
(
senderReports
,
sdesChunks
,
delaySinceLastRrSsrcInfo
s
))
{
{
return
false
;
return
false
;
}
}
...
...
worker/src/RTC/RTCP/CompoundPacket.cpp
浏览文件 @
e952f34f
...
@@ -72,7 +72,9 @@ namespace RTC
...
@@ -72,7 +72,9 @@ namespace RTC
}
}
bool
CompoundPacket
::
Add
(
bool
CompoundPacket
::
Add
(
SenderReport
*
senderReport
,
SdesChunk
*
sdesChunk
,
DelaySinceLastRr
*
delaySinceLastRrReport
)
SenderReport
*
senderReport
,
SdesChunk
*
sdesChunk
,
DelaySinceLastRr
::
SsrcInfo
*
delaySinceLastRrSsrcInfo
)
{
{
// Add the items into the packet.
// Add the items into the packet.
...
@@ -86,9 +88,16 @@ namespace RTC
...
@@ -86,9 +88,16 @@ namespace RTC
this
->
sdesPacket
.
AddChunk
(
sdesChunk
);
this
->
sdesPacket
.
AddChunk
(
sdesChunk
);
}
}
if
(
delaySinceLastRr
Report
)
if
(
delaySinceLastRr
SsrcInfo
)
{
{
this
->
xrPacket
.
AddReport
(
delaySinceLastRrReport
);
// Add a DLRR block into the XR packet if no present.
if
(
!
this
->
delaySinceLastRr
)
{
this
->
delaySinceLastRr
=
new
RTC
::
RTCP
::
DelaySinceLastRr
();
this
->
xrPacket
.
AddReport
(
this
->
delaySinceLastRr
);
}
this
->
delaySinceLastRr
->
AddSsrcInfo
(
delaySinceLastRrSsrcInfo
);
}
}
// New items can hold in the packet, report it.
// New items can hold in the packet, report it.
...
@@ -112,10 +121,10 @@ namespace RTC
...
@@ -112,10 +121,10 @@ namespace RTC
delete
sdesChunk
;
delete
sdesChunk
;
}
}
if
(
delaySinceLastRr
Report
)
if
(
delaySinceLastRr
SsrcInfo
)
{
{
this
->
xrPacket
.
RemoveReport
(
delaySinceLastRrReport
);
// NOTE: This method deletes the removed instances in place.
delete
delaySinceLastRrReport
;
this
->
delaySinceLastRr
->
RemoveLastSsrcInfos
(
1
)
;
}
}
return
false
;
return
false
;
...
@@ -124,7 +133,7 @@ namespace RTC
...
@@ -124,7 +133,7 @@ namespace RTC
bool
CompoundPacket
::
Add
(
bool
CompoundPacket
::
Add
(
std
::
vector
<
SenderReport
*>&
senderReports
,
std
::
vector
<
SenderReport
*>&
senderReports
,
std
::
vector
<
SdesChunk
*>&
sdesChunks
,
std
::
vector
<
SdesChunk
*>&
sdesChunks
,
std
::
vector
<
DelaySinceLastRr
*>&
delaySinceLastRrReport
s
)
std
::
vector
<
DelaySinceLastRr
::
SsrcInfo
*>&
delaySinceLastRrSsrcInfo
s
)
{
{
// Add the items into the packet.
// Add the items into the packet.
...
@@ -138,9 +147,16 @@ namespace RTC
...
@@ -138,9 +147,16 @@ namespace RTC
this
->
sdesPacket
.
AddChunk
(
chunk
);
this
->
sdesPacket
.
AddChunk
(
chunk
);
}
}
for
(
auto
*
report
:
delaySinceLastRrReports
)
// Add a DLRR block into the XR packet if no present.
if
(
!
delaySinceLastRrSsrcInfos
.
empty
()
&&
!
this
->
delaySinceLastRr
)
{
{
this
->
xrPacket
.
AddReport
(
report
);
this
->
delaySinceLastRr
=
new
RTC
::
RTCP
::
DelaySinceLastRr
();
this
->
xrPacket
.
AddReport
(
this
->
delaySinceLastRr
);
}
for
(
auto
*
ssrcInfo
:
delaySinceLastRrSsrcInfos
)
{
this
->
delaySinceLastRr
->
AddSsrcInfo
(
ssrcInfo
);
}
}
// New items can hold in the packet, report it.
// New items can hold in the packet, report it.
...
@@ -164,10 +180,10 @@ namespace RTC
...
@@ -164,10 +180,10 @@ namespace RTC
delete
chunk
;
delete
chunk
;
}
}
for
(
auto
*
report
:
delaySinceLastRrReports
)
if
(
!
delaySinceLastRrSsrcInfos
.
empty
()
)
{
{
this
->
xrPacket
.
RemoveReport
(
report
);
// NOTE: This method deletes the instances in place.
delete
report
;
this
->
delaySinceLastRr
->
RemoveLastSsrcInfos
(
delaySinceLastRrSsrcInfos
.
size
())
;
}
}
return
false
;
return
false
;
...
@@ -266,19 +282,5 @@ namespace RTC
...
@@ -266,19 +282,5 @@ namespace RTC
this
->
sdesPacket
.
AddChunk
(
chunk
);
this
->
sdesPacket
.
AddChunk
(
chunk
);
}
}
void
CompoundPacket
::
AddReceiverReferenceTime
(
ReceiverReferenceTime
*
report
)
{
MS_TRACE
();
this
->
xrPacket
.
AddReport
(
report
);
}
void
CompoundPacket
::
AddDelaySinceLastRr
(
DelaySinceLastRr
*
report
)
{
MS_TRACE
();
this
->
xrPacket
.
AddReport
(
report
);
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
e952f34f
...
@@ -274,7 +274,7 @@ namespace RTC
...
@@ -274,7 +274,7 @@ namespace RTC
return
report
;
return
report
;
}
}
RTC
::
RTCP
::
DelaySinceLastRr
::
SsrcInfo
*
RtpStreamSend
::
GetRtcpXrDelaySinceLastRr
(
uint64_t
nowMs
)
RTC
::
RTCP
::
DelaySinceLastRr
::
SsrcInfo
*
RtpStreamSend
::
GetRtcpXrDelaySinceLastRr
SsrcInfo
(
uint64_t
nowMs
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/SimpleConsumer.cpp
浏览文件 @
e952f34f
...
@@ -439,18 +439,10 @@ namespace RTC
...
@@ -439,18 +439,10 @@ namespace RTC
// Build SDES chunk for this sender.
// Build SDES chunk for this sender.
auto
*
sdesChunk
=
this
->
rtpStream
->
GetRtcpSdesChunk
();
auto
*
sdesChunk
=
this
->
rtpStream
->
GetRtcpSdesChunk
();
RTC
::
RTCP
::
DelaySinceLastRr
*
delaySinceLastRrReport
{
nullptr
};
auto
*
delaySinceLastRrSsrcInfo
=
this
->
rtpStream
->
GetRtcpXrDelaySinceLastRrSsrcInfo
(
nowMs
);
auto
*
dlrr
=
this
->
rtpStream
->
GetRtcpXrDelaySinceLastRr
(
nowMs
);
if
(
dlrr
)
{
delaySinceLastRrReport
=
new
RTC
::
RTCP
::
DelaySinceLastRr
();
delaySinceLastRrReport
->
AddSsrcInfo
(
dlrr
);
}
// RTCP Compound packet buffer cannot hold the data.
// RTCP Compound packet buffer cannot hold the data.
if
(
!
packet
->
Add
(
senderReport
,
sdesChunk
,
delaySinceLastRr
Report
))
if
(
!
packet
->
Add
(
senderReport
,
sdesChunk
,
delaySinceLastRr
SsrcInfo
))
{
{
return
false
;
return
false
;
}
}
...
...
worker/src/RTC/SimulcastConsumer.cpp
浏览文件 @
e952f34f
...
@@ -1081,18 +1081,10 @@ namespace RTC
...
@@ -1081,18 +1081,10 @@ namespace RTC
// Build SDES chunk for this sender.
// Build SDES chunk for this sender.
auto
*
sdesChunk
=
this
->
rtpStream
->
GetRtcpSdesChunk
();
auto
*
sdesChunk
=
this
->
rtpStream
->
GetRtcpSdesChunk
();
RTC
::
RTCP
::
DelaySinceLastRr
*
delaySinceLastRrReport
{
nullptr
};
auto
*
delaySinceLastRrSsrcInfo
=
this
->
rtpStream
->
GetRtcpXrDelaySinceLastRrSsrcInfo
(
nowMs
);
auto
*
dlrr
=
this
->
rtpStream
->
GetRtcpXrDelaySinceLastRr
(
nowMs
);
if
(
dlrr
)
{
delaySinceLastRrReport
=
new
RTC
::
RTCP
::
DelaySinceLastRr
();
delaySinceLastRrReport
->
AddSsrcInfo
(
dlrr
);
}
// RTCP Compound packet buffer cannot hold the data.
// RTCP Compound packet buffer cannot hold the data.
if
(
!
packet
->
Add
(
senderReport
,
sdesChunk
,
delaySinceLastRr
Report
))
if
(
!
packet
->
Add
(
senderReport
,
sdesChunk
,
delaySinceLastRr
SsrcInfo
))
{
{
return
false
;
return
false
;
}
}
...
...
worker/src/RTC/SvcConsumer.cpp
浏览文件 @
e952f34f
...
@@ -795,18 +795,10 @@ namespace RTC
...
@@ -795,18 +795,10 @@ namespace RTC
// Build SDES chunk for this sender.
// Build SDES chunk for this sender.
auto
*
sdesChunk
=
this
->
rtpStream
->
GetRtcpSdesChunk
();
auto
*
sdesChunk
=
this
->
rtpStream
->
GetRtcpSdesChunk
();
RTC
::
RTCP
::
DelaySinceLastRr
*
delaySinceLastRrReport
{
nullptr
};
auto
*
delaySinceLastRrSsrcInfo
=
this
->
rtpStream
->
GetRtcpXrDelaySinceLastRrSsrcInfo
(
nowMs
);
auto
*
dlrr
=
this
->
rtpStream
->
GetRtcpXrDelaySinceLastRr
(
nowMs
);
if
(
dlrr
)
{
delaySinceLastRrReport
=
new
RTC
::
RTCP
::
DelaySinceLastRr
();
delaySinceLastRrReport
->
AddSsrcInfo
(
dlrr
);
}
// RTCP Compound packet buffer cannot hold the data.
// RTCP Compound packet buffer cannot hold the data.
if
(
!
packet
->
Add
(
senderReport
,
sdesChunk
,
delaySinceLastRr
Report
))
if
(
!
packet
->
Add
(
senderReport
,
sdesChunk
,
delaySinceLastRr
SsrcInfo
))
{
{
return
false
;
return
false
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论