Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
dfb224ef
提交
dfb224ef
authored
4月 26, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix GetRtcp in PipeConsumer (avoid assert)
上级
feb7fd40
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
58 行增加
和
21 行删除
+58
-21
Consumer.hpp
worker/include/RTC/Consumer.hpp
+4
-1
PipeConsumer.hpp
worker/include/RTC/PipeConsumer.hpp
+11
-1
SimpleConsumer.hpp
worker/include/RTC/SimpleConsumer.hpp
+7
-1
SimulcastConsumer.hpp
worker/include/RTC/SimulcastConsumer.hpp
+7
-1
PipeConsumer.cpp
worker/src/RTC/PipeConsumer.cpp
+8
-6
SimpleConsumer.cpp
worker/src/RTC/SimpleConsumer.cpp
+4
-1
SimulcastConsumer.cpp
worker/src/RTC/SimulcastConsumer.cpp
+7
-2
Transport.cpp
worker/src/RTC/Transport.cpp
+10
-8
没有找到文件。
worker/include/RTC/Consumer.hpp
浏览文件 @
dfb224ef
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include "RTC/RtpHeaderExtensionIds.hpp"
#include "RTC/RtpHeaderExtensionIds.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpStream.hpp"
#include "RTC/RtpStream.hpp"
#include "RTC/RtpStreamSend.hpp"
#include <string>
#include <string>
#include <unordered_set>
#include <unordered_set>
#include <vector>
#include <vector>
...
@@ -67,7 +68,9 @@ namespace RTC
...
@@ -67,7 +68,9 @@ namespace RTC
virtual
uint32_t
IncreaseLayer
(
uint32_t
bitrate
);
virtual
uint32_t
IncreaseLayer
(
uint32_t
bitrate
);
virtual
void
ApplyLayers
();
virtual
void
ApplyLayers
();
virtual
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
=
0
;
virtual
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
=
0
;
virtual
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
=
0
;
virtual
std
::
vector
<
RTC
::
RtpStreamSend
*>
GetRtpStreams
()
=
0
;
virtual
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
=
0
;
virtual
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
=
0
;
virtual
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
=
0
;
virtual
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
=
0
;
virtual
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
=
0
;
virtual
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
=
0
;
virtual
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
=
0
;
...
...
worker/include/RTC/PipeConsumer.hpp
浏览文件 @
dfb224ef
...
@@ -21,7 +21,8 @@ namespace RTC
...
@@ -21,7 +21,8 @@ namespace RTC
void
ProducerNewRtpStream
(
RTC
::
RtpStream
*
rtpStream
,
uint32_t
mappedSsrc
)
override
;
void
ProducerNewRtpStream
(
RTC
::
RtpStream
*
rtpStream
,
uint32_t
mappedSsrc
)
override
;
void
ProducerRtpStreamScore
(
RTC
::
RtpStream
*
rtpStream
,
uint8_t
score
,
uint8_t
previousScore
)
override
;
void
ProducerRtpStreamScore
(
RTC
::
RtpStream
*
rtpStream
,
uint8_t
score
,
uint8_t
previousScore
)
override
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
override
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
override
;
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
override
;
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
override
;
std
::
vector
<
RTC
::
RtpStreamSend
*>
GetRtpStreams
()
override
;
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
override
;
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
override
;
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
override
;
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
override
;
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
override
;
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
override
;
...
@@ -44,7 +45,16 @@ namespace RTC
...
@@ -44,7 +45,16 @@ namespace RTC
private
:
private
:
// Allocated by this.
// Allocated by this.
std
::
unordered_map
<
uint32_t
,
RTC
::
RtpStreamSend
*>
mapMappedSsrcRtpStream
;
std
::
unordered_map
<
uint32_t
,
RTC
::
RtpStreamSend
*>
mapMappedSsrcRtpStream
;
// Others.
std
::
vector
<
RTC
::
RtpStreamSend
*>
rtpStreams
;
};
};
// Inline methods.
inline
std
::
vector
<
RTC
::
RtpStreamSend
*>
PipeConsumer
::
GetRtpStreams
()
{
return
this
->
rtpStreams
;
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/include/RTC/SimpleConsumer.hpp
浏览文件 @
dfb224ef
...
@@ -23,7 +23,8 @@ namespace RTC
...
@@ -23,7 +23,8 @@ namespace RTC
void
ProducerNewRtpStream
(
RTC
::
RtpStream
*
rtpStream
,
uint32_t
mappedSsrc
)
override
;
void
ProducerNewRtpStream
(
RTC
::
RtpStream
*
rtpStream
,
uint32_t
mappedSsrc
)
override
;
void
ProducerRtpStreamScore
(
RTC
::
RtpStream
*
rtpStream
,
uint8_t
score
,
uint8_t
previousScore
)
override
;
void
ProducerRtpStreamScore
(
RTC
::
RtpStream
*
rtpStream
,
uint8_t
score
,
uint8_t
previousScore
)
override
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
override
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
override
;
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
override
;
std
::
vector
<
RTC
::
RtpStreamSend
*>
GetRtpStreams
()
override
;
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
override
;
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
override
;
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
override
;
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
override
;
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
override
;
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
override
;
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
override
;
...
@@ -61,6 +62,11 @@ namespace RTC
...
@@ -61,6 +62,11 @@ namespace RTC
{
{
return
(
RTC
::
Consumer
::
IsActive
()
&&
this
->
producerRtpStream
);
return
(
RTC
::
Consumer
::
IsActive
()
&&
this
->
producerRtpStream
);
}
}
inline
std
::
vector
<
RTC
::
RtpStreamSend
*>
SimpleConsumer
::
GetRtpStreams
()
{
return
std
::
vector
<
RTC
::
RtpStreamSend
*>
{
this
->
rtpStream
};
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/include/RTC/SimulcastConsumer.hpp
浏览文件 @
dfb224ef
...
@@ -29,7 +29,8 @@ namespace RTC
...
@@ -29,7 +29,8 @@ namespace RTC
uint32_t
IncreaseLayer
(
uint32_t
bitrate
)
override
;
uint32_t
IncreaseLayer
(
uint32_t
bitrate
)
override
;
void
ApplyLayers
()
override
;
void
ApplyLayers
()
override
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
override
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
override
;
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
override
;
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
override
;
std
::
vector
<
RTC
::
RtpStreamSend
*>
GetRtpStreams
()
override
;
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
override
;
void
NeedWorstRemoteFractionLost
(
uint32_t
mappedSsrc
,
uint8_t
&
worstRemoteFractionLost
)
override
;
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
override
;
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
)
override
;
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
override
;
void
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
override
;
...
@@ -99,6 +100,11 @@ namespace RTC
...
@@ -99,6 +100,11 @@ namespace RTC
);
);
// clang-format on
// clang-format on
}
}
inline
std
::
vector
<
RTC
::
RtpStreamSend
*>
SimulcastConsumer
::
GetRtpStreams
()
{
return
std
::
vector
<
RTC
::
RtpStreamSend
*>
{
this
->
rtpStream
};
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/src/RTC/PipeConsumer.cpp
浏览文件 @
dfb224ef
...
@@ -128,20 +128,22 @@ namespace RTC
...
@@ -128,20 +128,22 @@ namespace RTC
}
}
}
}
void
PipeConsumer
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
void
PipeConsumer
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
{
{
MS_TRACE
();
MS_TRACE
();
MS_ASSERT
(
std
::
find
(
this
->
rtpStreams
.
begin
(),
this
->
rtpStreams
.
end
(),
rtpStream
)
!=
this
->
rtpStreams
.
end
(),
"RTP stream does exist"
);
if
(
static_cast
<
float
>
((
now
-
this
->
lastRtcpSentTime
)
*
1.15
)
<
this
->
maxRtcpInterval
)
if
(
static_cast
<
float
>
((
now
-
this
->
lastRtcpSentTime
)
*
1.15
)
<
this
->
maxRtcpInterval
)
return
;
return
;
for
(
auto
&
kv
:
this
->
mapMappedSsrcRtpStream
)
{
auto
&
rtpStream
=
kv
.
second
;
auto
*
report
=
rtpStream
->
GetRtcpSenderReport
(
now
);
auto
*
report
=
rtpStream
->
GetRtcpSenderReport
(
now
);
if
(
!
report
)
if
(
!
report
)
continue
;
return
;
packet
->
AddSenderReport
(
report
);
packet
->
AddSenderReport
(
report
);
...
@@ -152,7 +154,6 @@ namespace RTC
...
@@ -152,7 +154,6 @@ namespace RTC
this
->
lastRtcpSentTime
=
now
;
this
->
lastRtcpSentTime
=
now
;
}
}
}
void
PipeConsumer
::
NeedWorstRemoteFractionLost
(
uint32_t
/*mappedSsrc*/
,
uint8_t
&
worstRemoteFractionLost
)
void
PipeConsumer
::
NeedWorstRemoteFractionLost
(
uint32_t
/*mappedSsrc*/
,
uint8_t
&
worstRemoteFractionLost
)
{
{
...
@@ -363,6 +364,7 @@ namespace RTC
...
@@ -363,6 +364,7 @@ namespace RTC
rtpStream
->
SetRtx
(
rtxCodec
->
payloadType
,
encoding
.
rtx
.
ssrc
);
rtpStream
->
SetRtx
(
rtxCodec
->
payloadType
,
encoding
.
rtx
.
ssrc
);
this
->
mapMappedSsrcRtpStream
[
encoding
.
ssrc
]
=
rtpStream
;
this
->
mapMappedSsrcRtpStream
[
encoding
.
ssrc
]
=
rtpStream
;
this
->
rtpStreams
.
push_back
(
rtpStream
);
}
}
}
}
...
...
worker/src/RTC/SimpleConsumer.cpp
浏览文件 @
dfb224ef
...
@@ -233,10 +233,13 @@ namespace RTC
...
@@ -233,10 +233,13 @@ namespace RTC
packet
->
SetTimestamp
(
origTimestamp
);
packet
->
SetTimestamp
(
origTimestamp
);
}
}
void
SimpleConsumer
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
void
SimpleConsumer
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
{
{
MS_TRACE
();
MS_TRACE
();
MS_ASSERT
(
rtpStream
==
this
->
rtpStream
,
"RTP stream does not match"
);
if
(
static_cast
<
float
>
((
now
-
this
->
lastRtcpSentTime
)
*
1.15
)
<
this
->
maxRtcpInterval
)
if
(
static_cast
<
float
>
((
now
-
this
->
lastRtcpSentTime
)
*
1.15
)
<
this
->
maxRtcpInterval
)
return
;
return
;
...
...
worker/src/RTC/SimulcastConsumer.cpp
浏览文件 @
dfb224ef
...
@@ -587,7 +587,9 @@ namespace RTC
...
@@ -587,7 +587,9 @@ namespace RTC
if
(
this
->
keyFrameSupported
&&
!
packet
->
IsKeyFrame
())
if
(
this
->
keyFrameSupported
&&
!
packet
->
IsKeyFrame
())
return
;
return
;
MS_ERROR
(
"calling UpdateCurrentLayer [currentSpatialLayer:%"
PRIu16
", targetSpatialLayer:%"
PRIu16
", isKeyFrame:%s]"
,
MS_ERROR
(
"calling UpdateCurrentLayer [currentSpatialLayer:%"
PRIu16
", targetSpatialLayer:%"
PRIu16
", isKeyFrame:%s]"
,
this
->
currentSpatialLayer
,
this
->
currentSpatialLayer
,
this
->
targetSpatialLayer
,
this
->
targetSpatialLayer
,
packet
->
IsKeyFrame
()
?
"true"
:
"false"
);
packet
->
IsKeyFrame
()
?
"true"
:
"false"
);
...
@@ -717,10 +719,13 @@ namespace RTC
...
@@ -717,10 +719,13 @@ namespace RTC
packet
->
RestorePayload
();
packet
->
RestorePayload
();
}
}
void
SimulcastConsumer
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
void
SimulcastConsumer
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
{
{
MS_TRACE
();
MS_TRACE
();
MS_ASSERT
(
rtpStream
==
this
->
rtpStream
,
"RTP stream does not match"
);
if
(
static_cast
<
float
>
((
now
-
this
->
lastRtcpSentTime
)
*
1.15
)
<
this
->
maxRtcpInterval
)
if
(
static_cast
<
float
>
((
now
-
this
->
lastRtcpSentTime
)
*
1.15
)
<
this
->
maxRtcpInterval
)
return
;
return
;
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
dfb224ef
...
@@ -760,28 +760,30 @@ namespace RTC
...
@@ -760,28 +760,30 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// - Create a CompoundPacket.
std
::
unique_ptr
<
RTC
::
RTCP
::
CompoundPacket
>
packet
{
nullptr
};
// - Request every Consumer and Producer their RTCP data.
// - Send the CompoundPacket.
std
::
unique_ptr
<
RTC
::
RTCP
::
CompoundPacket
>
packet
(
new
RTC
::
RTCP
::
CompoundPacket
());
for
(
auto
&
kv
:
this
->
mapConsumers
)
for
(
auto
&
kv
:
this
->
mapConsumers
)
{
{
auto
*
consumer
=
kv
.
second
;
auto
*
consumer
=
kv
.
second
;
consumer
->
GetRtcp
(
packet
.
get
(),
now
);
for
(
auto
&
rtpStream
:
consumer
->
GetRtpStreams
())
{
// Reset the Compound packet.
packet
.
reset
(
new
RTC
::
RTCP
::
CompoundPacket
());
consumer
->
GetRtcp
(
packet
.
get
(),
rtpStream
,
now
);
// Send the RTCP compound packet if there is a sender report.
// Send the RTCP compound packet if there is a sender report.
if
(
packet
->
HasSenderReport
())
if
(
packet
->
HasSenderReport
())
{
{
packet
->
Serialize
(
RTC
::
RTCP
::
Buffer
);
packet
->
Serialize
(
RTC
::
RTCP
::
Buffer
);
SendRtcpCompoundPacket
(
packet
.
get
());
SendRtcpCompoundPacket
(
packet
.
get
());
}
}
}
// Reset the Compound packet.
// Reset the Compound packet.
packet
.
reset
(
new
RTC
::
RTCP
::
CompoundPacket
());
packet
.
reset
(
new
RTC
::
RTCP
::
CompoundPacket
());
}
}
for
(
auto
&
kv
:
this
->
mapProducers
)
for
(
auto
&
kv
:
this
->
mapProducers
)
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论