Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
fad0a085
提交
fad0a085
authored
9月 11, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete stream on unhealthy
上级
f99f1f85
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
19 行删除
+44
-19
Producer.hpp
worker/include/RTC/Producer.hpp
+1
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+43
-19
没有找到文件。
worker/include/RTC/Producer.hpp
浏览文件 @
fad0a085
...
@@ -89,6 +89,7 @@ namespace RTC
...
@@ -89,6 +89,7 @@ namespace RTC
private
:
private
:
void
FillHeaderExtensionIds
();
void
FillHeaderExtensionIds
();
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
ClearRtpStream
(
RTC
::
RtpStreamRecv
*
rtpStream
);
void
ClearRtpStreams
();
void
ClearRtpStreams
();
void
ApplyRtpMapping
(
RTC
::
RtpPacket
*
packet
)
const
;
void
ApplyRtpMapping
(
RTC
::
RtpPacket
*
packet
)
const
;
RTC
::
RtpEncodingParameters
::
Profile
GetProfile
(
RTC
::
RtpStreamRecv
*
rtpStream
,
RTC
::
RtpPacket
*
packet
);
RTC
::
RtpEncodingParameters
::
Profile
GetProfile
(
RTC
::
RtpStreamRecv
*
rtpStream
,
RTC
::
RtpPacket
*
packet
);
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
fad0a085
...
@@ -269,9 +269,7 @@ namespace RTC
...
@@ -269,9 +269,7 @@ namespace RTC
for
(
auto
&
encoding
:
this
->
rtpParameters
.
encodings
)
for
(
auto
&
encoding
:
this
->
rtpParameters
.
encodings
)
{
{
// TODO: This is not ready for RID usage (without SSRC in encodings).
// TODO: This is not ready for RID usage (without SSRC in encodings).
if
(
if
(
encoding
.
ssrc
==
ssrc
)
encoding
.
ssrc
==
ssrc
||
(
encoding
.
hasRtx
&&
encoding
.
rtx
.
ssrc
==
ssrc
)
||
(
encoding
.
hasFec
&&
encoding
.
fec
.
ssrc
==
ssrc
))
{
{
CreateRtpStream
(
encoding
);
CreateRtpStream
(
encoding
);
...
@@ -494,10 +492,7 @@ namespace RTC
...
@@ -494,10 +492,7 @@ namespace RTC
uint32_t
ssrc
=
encoding
.
ssrc
;
uint32_t
ssrc
=
encoding
.
ssrc
;
// Don't create a RtpStreamRecv if there is already one for the same SSRC.
MS_ASSERT
(
this
->
rtpStreams
.
find
(
ssrc
)
==
this
->
rtpStreams
.
end
(),
"stream already exists"
);
// TODO: This may not work for SVC codecs.
if
(
this
->
rtpStreams
.
find
(
ssrc
)
!=
this
->
rtpStreams
.
end
())
return
;
// Get the codec of the stream/encoding.
// Get the codec of the stream/encoding.
auto
&
codec
=
this
->
rtpParameters
.
GetCodecForEncoding
(
encoding
);
auto
&
codec
=
this
->
rtpParameters
.
GetCodecForEncoding
(
encoding
);
...
@@ -575,6 +570,45 @@ namespace RTC
...
@@ -575,6 +570,45 @@ namespace RTC
}
}
}
}
void
Producer
::
ClearRtpStream
(
RTC
::
RtpStreamRecv
*
rtpStream
)
{
MS_TRACE
();
auto
&
profiles
=
this
->
profiles
[
rtpStream
];
// Notify about the profiles being disabled.
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
.
erase
(
rtpStream
->
GetSsrc
());
for
(
auto
&
kv
:
this
->
mapRtxStreams
)
{
auto
rtxSsrc
=
kv
.
first
;
auto
*
mediaStream
=
kv
.
second
;
if
(
mediaStream
==
rtpStream
)
{
this
->
mapRtxStreams
.
erase
(
rtxSsrc
);
break
;
}
}
this
->
profiles
.
erase
(
rtpStream
);
delete
rtpStream
;
}
void
Producer
::
ClearRtpStreams
()
void
Producer
::
ClearRtpStreams
()
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -738,18 +772,8 @@ namespace RTC
...
@@ -738,18 +772,8 @@ namespace RTC
{
{
MS_DEBUG_TAG
(
rtp
,
"stream is now unhealthy [ssrc:%"
PRIu32
"]"
,
rtpStream
->
GetSsrc
());
MS_DEBUG_TAG
(
rtp
,
"stream is now unhealthy [ssrc:%"
PRIu32
"]"
,
rtpStream
->
GetSsrc
());
// Notify about the profiles being disabled.
// Completely destroy the stream.
for
(
auto
&
profile
:
profiles
)
ClearRtpStream
(
rtpStreamRecv
);
{
// 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
);
}
}
}
}
// The stream has transitioned to healthy.
// The stream has transitioned to healthy.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论