Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
3f556c14
提交
3f556c14
authored
4月 28, 2019
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PipeConsumer: honor the mapped ssrcs
上级
5af3da9b
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
19 行增加
和
35 行删除
+19
-35
ortc.js
lib/ortc.js
+3
-1
Consumer.hpp
worker/include/RTC/Consumer.hpp
+2
-1
PipeConsumer.hpp
worker/include/RTC/PipeConsumer.hpp
+1
-1
SimpleConsumer.hpp
worker/include/RTC/SimpleConsumer.hpp
+1
-1
SimulcastConsumer.hpp
worker/include/RTC/SimulcastConsumer.hpp
+1
-1
PipeConsumer.cpp
worker/src/RTC/PipeConsumer.cpp
+6
-27
SimpleConsumer.cpp
worker/src/RTC/SimpleConsumer.cpp
+2
-1
SimulcastConsumer.cpp
worker/src/RTC/SimulcastConsumer.cpp
+2
-1
Transport.cpp
worker/src/RTC/Transport.cpp
+1
-1
没有找到文件。
lib/ortc.js
浏览文件 @
3f556c14
...
@@ -229,11 +229,13 @@ exports.getProducerRtpParametersMapping = function(params, caps)
...
@@ -229,11 +229,13 @@ exports.getProducerRtpParametersMapping = function(params, caps)
}
}
// Generate encodings mapping.
// Generate encodings mapping.
let
mappedSsrc
=
utils
.
generateRandomNumber
();
for
(
const
encoding
of
(
params
.
encodings
||
[]))
for
(
const
encoding
of
(
params
.
encodings
||
[]))
{
{
const
mappedEncoding
=
{};
const
mappedEncoding
=
{};
mappedEncoding
.
mappedSsrc
=
utils
.
generateRandomNumber
()
;
mappedEncoding
.
mappedSsrc
=
mappedSsrc
++
;
if
(
encoding
.
rid
)
if
(
encoding
.
rid
)
mappedEncoding
.
rid
=
encoding
.
rid
;
mappedEncoding
.
rid
=
encoding
.
rid
;
...
...
worker/include/RTC/Consumer.hpp
浏览文件 @
3f556c14
...
@@ -73,7 +73,8 @@ namespace RTC
...
@@ -73,7 +73,8 @@ namespace RTC
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
=
0
;
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
,
uint32_t
ssrc
)
=
0
;
virtual
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
=
0
;
virtual
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
=
0
;
virtual
uint32_t
GetTransmissionRate
(
uint64_t
now
)
=
0
;
virtual
uint32_t
GetTransmissionRate
(
uint64_t
now
)
=
0
;
...
...
worker/include/RTC/PipeConsumer.hpp
浏览文件 @
3f556c14
...
@@ -26,7 +26,7 @@ namespace RTC
...
@@ -26,7 +26,7 @@ namespace RTC
std
::
vector
<
RTC
::
RtpStreamSend
*>
GetRtpStreams
()
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
,
uint32_t
ssrc
)
override
;
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
override
;
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
override
;
uint32_t
GetTransmissionRate
(
uint64_t
now
)
override
;
uint32_t
GetTransmissionRate
(
uint64_t
now
)
override
;
...
...
worker/include/RTC/SimpleConsumer.hpp
浏览文件 @
3f556c14
...
@@ -27,7 +27,7 @@ namespace RTC
...
@@ -27,7 +27,7 @@ namespace RTC
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
RTC
::
RtpStreamSend
*
rtpStream
,
uint64_t
now
)
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
,
uint32_t
ssrc
)
override
;
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
override
;
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
override
;
uint32_t
GetTransmissionRate
(
uint64_t
now
)
override
;
uint32_t
GetTransmissionRate
(
uint64_t
now
)
override
;
...
...
worker/include/RTC/SimulcastConsumer.hpp
浏览文件 @
3f556c14
...
@@ -33,7 +33,7 @@ namespace RTC
...
@@ -33,7 +33,7 @@ namespace RTC
std
::
vector
<
RTC
::
RtpStreamSend
*>
GetRtpStreams
()
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
,
uint32_t
ssrc
)
override
;
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
override
;
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
override
;
uint32_t
GetTransmissionRate
(
uint64_t
now
)
override
;
uint32_t
GetTransmissionRate
(
uint64_t
now
)
override
;
...
...
worker/src/RTC/PipeConsumer.cpp
浏览文件 @
3f556c14
...
@@ -162,8 +162,6 @@ namespace RTC
...
@@ -162,8 +162,6 @@ namespace RTC
rtpTimestampManager
.
Offset
(
diffTs
);
rtpTimestampManager
.
Offset
(
diffTs
);
}
}
// TODO: Is this correct? syncRequired is taken by reference from the map.
// I assume that changing its value here also modifies its value in the map.
syncRequired
=
false
;
syncRequired
=
false
;
}
}
...
@@ -175,12 +173,11 @@ namespace RTC
...
@@ -175,12 +173,11 @@ namespace RTC
rtpTimestampManager
.
Input
(
packet
->
GetTimestamp
(),
timestamp
);
rtpTimestampManager
.
Input
(
packet
->
GetTimestamp
(),
timestamp
);
// Save original packet fields.
// Save original packet fields.
auto
origSsrc
=
packet
->
GetSsrc
();
auto
origSeq
=
packet
->
GetSequenceNumber
();
auto
origSeq
=
packet
->
GetSequenceNumber
();
auto
origTimestamp
=
packet
->
GetTimestamp
();
auto
origTimestamp
=
packet
->
GetTimestamp
();
// Rewrite packet.
// Rewrite packet.
packet
->
SetSsrc
(
this
->
rtpParameters
.
encodings
[
0
].
ssrc
);
// NOTE: Do not override the ssrc because we want to honor the consumable ssrcs.
packet
->
SetSequenceNumber
(
seq
);
packet
->
SetSequenceNumber
(
seq
);
packet
->
SetTimestamp
(
timestamp
);
packet
->
SetTimestamp
(
timestamp
);
...
@@ -217,7 +214,6 @@ namespace RTC
...
@@ -217,7 +214,6 @@ namespace RTC
}
}
// Restore packet fields.
// Restore packet fields.
packet
->
SetSsrc
(
origSsrc
);
packet
->
SetSequenceNumber
(
origSeq
);
packet
->
SetSequenceNumber
(
origSeq
);
packet
->
SetTimestamp
(
origTimestamp
);
packet
->
SetTimestamp
(
origTimestamp
);
}
}
...
@@ -274,20 +270,13 @@ namespace RTC
...
@@ -274,20 +270,13 @@ namespace RTC
// Do nothing since we do not enable NACK.
// Do nothing since we do not enable NACK.
}
}
void
PipeConsumer
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
/*messageType*/
)
void
PipeConsumer
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
,
uint32_t
ssrc
)
{
{
MS_TRACE
();
MS_TRACE
();
// TODO: Must get the associated RTP stream (based on the media ssrc of the
auto
*
rtpStream
=
this
->
mapMappedSsrcRtpStream
.
at
(
ssrc
);
// feedback, and it may not exist so ignore it) and call:
// rtpStream->ReceiveKeyFrameRequest(messageType);
rtpStream
->
ReceiveKeyFrameRequest
(
messageType
);
//
// NOTE: In order to match the ssrc take into account what is done below
// in ReceiveRtcpReceiverReport().
//
// TODO: This is impossible since this method does not receive the feedback
// message but just its messageType. The signature must be changed. It may,
// for example, receive the media ssrc (the mapped ssrc) as second argument).
if
(
IsActive
())
if
(
IsActive
())
RequestKeyFrame
();
RequestKeyFrame
();
...
@@ -297,17 +286,10 @@ namespace RTC
...
@@ -297,17 +286,10 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// TODO: Review this.
auto
*
rtpStream
=
this
->
mapMappedSsrcRtpStream
.
at
(
report
->
GetSsrc
());
auto
it
=
this
->
mapMappedSsrcRtpStream
.
find
(
report
->
GetSsrc
());
if
(
it
!=
this
->
mapMappedSsrcRtpStream
.
end
())
{
auto
*
rtpStream
=
it
->
second
;
rtpStream
->
ReceiveRtcpReceiverReport
(
report
);
rtpStream
->
ReceiveRtcpReceiverReport
(
report
);
}
}
}
uint32_t
PipeConsumer
::
GetTransmissionRate
(
uint64_t
now
)
uint32_t
PipeConsumer
::
GetTransmissionRate
(
uint64_t
now
)
{
{
...
@@ -493,9 +475,6 @@ namespace RTC
...
@@ -493,9 +475,6 @@ namespace RTC
if
(
this
->
kind
!=
RTC
::
Media
::
Kind
::
VIDEO
)
if
(
this
->
kind
!=
RTC
::
Media
::
Kind
::
VIDEO
)
return
;
return
;
// TODO: Review this (just call pipeConsumer.requestKeyFrame() in Node and
// verify that the sender browser receives a PLI for each simulcast stream).
for
(
auto
&
consumableRtpEncoding
:
this
->
consumableRtpEncodings
)
for
(
auto
&
consumableRtpEncoding
:
this
->
consumableRtpEncodings
)
{
{
auto
mappedSsrc
=
consumableRtpEncoding
.
ssrc
;
auto
mappedSsrc
=
consumableRtpEncoding
.
ssrc
;
...
...
worker/src/RTC/SimpleConsumer.cpp
浏览文件 @
3f556c14
...
@@ -277,7 +277,8 @@ namespace RTC
...
@@ -277,7 +277,8 @@ namespace RTC
this
->
rtpStream
->
ReceiveNack
(
nackPacket
);
this
->
rtpStream
->
ReceiveNack
(
nackPacket
);
}
}
void
SimpleConsumer
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
void
SimpleConsumer
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
,
uint32_t
/*ssrc*/
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/SimulcastConsumer.cpp
浏览文件 @
3f556c14
...
@@ -756,7 +756,8 @@ namespace RTC
...
@@ -756,7 +756,8 @@ namespace RTC
this
->
rtpStream
->
ReceiveNack
(
nackPacket
);
this
->
rtpStream
->
ReceiveNack
(
nackPacket
);
}
}
void
SimulcastConsumer
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
void
SimulcastConsumer
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
,
uint32_t
/*ssrc*/
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
3f556c14
...
@@ -517,7 +517,7 @@ namespace RTC
...
@@ -517,7 +517,7 @@ namespace RTC
feedback
->
GetMediaSsrc
(),
feedback
->
GetMediaSsrc
(),
feedback
->
GetMediaSsrc
());
feedback
->
GetMediaSsrc
());
consumer
->
ReceiveKeyFrameRequest
(
feedback
->
GetMessageType
());
consumer
->
ReceiveKeyFrameRequest
(
feedback
->
GetMessageType
()
,
feedback
->
GetMediaSsrc
()
);
break
;
break
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论