Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
7acf9437
提交
7acf9437
authored
9月 11, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
various fixes
上级
059527a6
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
47 行增加
和
56 行删除
+47
-56
Producer.cpp
worker/src/RTC/Producer.cpp
+47
-56
没有找到文件。
worker/src/RTC/Producer.cpp
浏览文件 @
7acf9437
...
@@ -50,6 +50,8 @@ namespace RTC
...
@@ -50,6 +50,8 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
this
->
profiles
.
clear
();
ClearRtpStreams
();
ClearRtpStreams
();
}
}
...
@@ -152,24 +154,6 @@ namespace RTC
...
@@ -152,24 +154,6 @@ namespace RTC
this
->
rtpParameters
=
rtpParameters
;
this
->
rtpParameters
=
rtpParameters
;
// Notify about all profiles being disabled.
for
(
auto
&
kv
:
this
->
profiles
)
{
auto
&
profiles
=
kv
.
second
;
for
(
auto
profile
:
profiles
)
{
// Don't announce default profile, but just those for simulcast/SVC.
if
(
profile
==
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
)
break
;
for
(
auto
&
listener
:
this
->
listeners
)
{
listener
->
OnProducerProfileDisabled
(
this
,
profile
);
}
}
}
// Clear previous RtpStreamRecv instances.
// Clear previous RtpStreamRecv instances.
ClearRtpStreams
();
ClearRtpStreams
();
...
@@ -325,10 +309,6 @@ namespace RTC
...
@@ -325,10 +309,6 @@ namespace RTC
return
;
return
;
}
}
// If paused stop here.
if
(
this
->
paused
)
return
;
RTC
::
RtpEncodingParameters
::
Profile
profile
;
RTC
::
RtpEncodingParameters
::
Profile
profile
;
try
try
...
@@ -340,6 +320,10 @@ namespace RTC
...
@@ -340,6 +320,10 @@ namespace RTC
return
;
return
;
}
}
// If paused stop here.
if
(
this
->
paused
)
return
;
// Apply the Producer codec payload type and extension header mapping before
// Apply the Producer codec payload type and extension header mapping before
// dispatching the packet.
// dispatching the packet.
ApplyRtpMapping
(
packet
);
ApplyRtpMapping
(
packet
);
...
@@ -508,12 +492,6 @@ namespace RTC
...
@@ -508,12 +492,6 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// Don't create an RtpStreamRecv if the encoding has no SSRC.
// TODO: For simulcast or, if not announced, this would be done
// dynamicall by the RtpListener when matching a RID with its SSRC.
if
(
encoding
.
ssrc
==
0u
)
return
;
uint32_t
ssrc
=
encoding
.
ssrc
;
uint32_t
ssrc
=
encoding
.
ssrc
;
// Don't create a RtpStreamRecv if there is already one for the same SSRC.
// Don't create a RtpStreamRecv if there is already one for the same SSRC.
...
@@ -560,7 +538,9 @@ namespace RTC
...
@@ -560,7 +538,9 @@ namespace RTC
params
.
usePli
=
usePli
;
params
.
usePli
=
usePli
;
// Create a RtpStreamRecv for receiving a media stream.
// Create a RtpStreamRecv for receiving a media stream.
this
->
rtpStreams
[
ssrc
]
=
new
RTC
::
RtpStreamRecv
(
this
,
params
);
auto
*
rtpStream
=
new
RTC
::
RtpStreamRecv
(
this
,
params
);
this
->
rtpStreams
[
ssrc
]
=
rtpStream
;
// Enable REMB in the transport if requested.
// Enable REMB in the transport if requested.
if
(
useRemb
)
if
(
useRemb
)
...
@@ -578,6 +558,21 @@ namespace RTC
...
@@ -578,6 +558,21 @@ namespace RTC
rtpStream
->
SetRtx
(
codec
.
payloadType
,
encoding
.
rtx
.
ssrc
);
rtpStream
->
SetRtx
(
codec
.
payloadType
,
encoding
.
rtx
.
ssrc
);
this
->
mapRtxStreams
[
encoding
.
rtx
.
ssrc
]
=
rtpStream
;
this
->
mapRtxStreams
[
encoding
.
rtx
.
ssrc
]
=
rtpStream
;
}
}
// Enter the stream into the profiles map.
// NOTE: This is specific to simulcast with no temporal layers.
auto
profile
=
encoding
.
profile
;
this
->
profiles
[
rtpStream
].
insert
(
profile
);
// Don't announce default profile, but just those for simulcast/SVC.
if
(
profile
!=
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
)
{
for
(
auto
&
listener
:
this
->
listeners
)
{
listener
->
OnProducerProfileEnabled
(
this
,
profile
);
}
}
}
}
void
Producer
::
ClearRtpStreams
()
void
Producer
::
ClearRtpStreams
()
...
@@ -591,6 +586,24 @@ namespace RTC
...
@@ -591,6 +586,24 @@ namespace RTC
delete
rtpStream
;
delete
rtpStream
;
}
}
// Notify about all profiles being disabled.
for
(
auto
&
kv
:
this
->
profiles
)
{
auto
&
profiles
=
kv
.
second
;
for
(
auto
profile
:
profiles
)
{
// Don't announce default profile, but just those for simulcast/SVC.
if
(
profile
==
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
)
break
;
for
(
auto
&
listener
:
this
->
listeners
)
{
listener
->
OnProducerProfileDisabled
(
this
,
profile
);
}
}
}
this
->
rtpStreams
.
clear
();
this
->
rtpStreams
.
clear
();
this
->
mapRtxStreams
.
clear
();
this
->
mapRtxStreams
.
clear
();
this
->
profiles
.
clear
();
this
->
profiles
.
clear
();
...
@@ -643,32 +656,7 @@ namespace RTC
...
@@ -643,32 +656,7 @@ namespace RTC
return
profile
;
return
profile
;
}
}
auto
ssrc
=
packet
->
GetSsrc
();
MS_THROW_ERROR
(
"unknown RTP packet received [ssrc:%"
PRIu32
"]"
,
packet
->
GetSsrc
());
// Look for the encoding associated with the SSRC.
// NOTE: This is specific to simulcast with no temporal layers.
for
(
auto
&
encoding
:
this
->
rtpParameters
.
encodings
)
{
if
(
encoding
.
ssrc
==
ssrc
)
{
auto
profile
=
encoding
.
profile
;
this
->
profiles
[
rtpStream
].
insert
(
profile
);
// Don't announce default profile, but just those for simulcast/SVC.
if
(
profile
!=
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
)
{
for
(
auto
&
listener
:
this
->
listeners
)
{
listener
->
OnProducerProfileEnabled
(
this
,
profile
);
}
}
return
profile
;
}
}
MS_THROW_ERROR
(
"unknown RTP packet received [ssrc:%"
PRIu32
"]"
,
ssrc
);
}
}
void
Producer
::
OnRtpStreamRecvNackRequired
(
void
Producer
::
OnRtpStreamRecvNackRequired
(
...
@@ -740,7 +728,10 @@ namespace RTC
...
@@ -740,7 +728,10 @@ namespace RTC
MS_TRACE
();
MS_TRACE
();
auto
rtpStreamRecv
=
static_cast
<
RtpStreamRecv
*>
(
rtpStream
);
auto
rtpStreamRecv
=
static_cast
<
RtpStreamRecv
*>
(
rtpStream
);
auto
&
profiles
=
this
->
profiles
[
rtpStreamRecv
];
MS_ASSERT
(
this
->
profiles
.
find
(
rtpStreamRecv
)
!=
this
->
profiles
.
end
(),
"stream not present in profiles map"
);
auto
&
profiles
=
this
->
profiles
[
rtpStreamRecv
];
// The stream has transitioned to non healthy.
// The stream has transitioned to non healthy.
if
(
rtpStream
->
IsHealthy
()
&&
!
healthy
)
if
(
rtpStream
->
IsHealthy
()
&&
!
healthy
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论