Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
b9532fcf
提交
b9532fcf
authored
10月 10, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Producer: Do not destroy the stream upon RTP inactivity
上级
37450db9
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
47 行增加
和
9 行删除
+47
-9
Consumer.hpp
worker/include/RTC/Consumer.hpp
+1
-1
Producer.hpp
worker/include/RTC/Producer.hpp
+1
-1
RtpStream.hpp
worker/include/RTC/RtpStream.hpp
+7
-1
Consumer.cpp
worker/src/RTC/Consumer.cpp
+1
-1
Producer.cpp
worker/src/RTC/Producer.cpp
+36
-4
RtpStreamRecv.cpp
worker/src/RTC/RtpStreamRecv.cpp
+1
-1
没有找到文件。
worker/include/RTC/Consumer.hpp
浏览文件 @
b9532fcf
...
@@ -73,7 +73,7 @@ namespace RTC
...
@@ -73,7 +73,7 @@ namespace RTC
/* Pure virtual methods inherited from RTC::RtpStream::Listener. */
/* Pure virtual methods inherited from RTC::RtpStream::Listener. */
public
:
public
:
void
OnRtpStream
Died
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStream
Inactivity
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamUnhealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamUnhealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
...
...
worker/include/RTC/Producer.hpp
浏览文件 @
b9532fcf
...
@@ -90,7 +90,7 @@ namespace RTC
...
@@ -90,7 +90,7 @@ namespace RTC
void
OnRtpStreamRecvNackRequired
(
void
OnRtpStreamRecvNackRequired
(
RTC
::
RtpStreamRecv
*
rtpStream
,
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
override
;
RTC
::
RtpStreamRecv
*
rtpStream
,
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
override
;
void
OnRtpStreamRecvPliRequired
(
RTC
::
RtpStreamRecv
*
rtpStream
)
override
;
void
OnRtpStreamRecvPliRequired
(
RTC
::
RtpStreamRecv
*
rtpStream
)
override
;
void
OnRtpStream
Died
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStream
Inactivity
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamUnhealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
void
OnRtpStreamUnhealthy
(
RTC
::
RtpStream
*
rtpStream
)
override
;
...
...
worker/include/RTC/RtpStream.hpp
浏览文件 @
b9532fcf
...
@@ -16,7 +16,7 @@ namespace RTC
...
@@ -16,7 +16,7 @@ namespace RTC
class
Listener
class
Listener
{
{
public
:
public
:
virtual
void
OnRtpStream
Died
(
RTC
::
RtpStream
*
rtpStream
)
=
0
;
virtual
void
OnRtpStream
Inactivity
(
RTC
::
RtpStream
*
rtpStream
)
=
0
;
virtual
void
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
=
0
;
virtual
void
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
=
0
;
virtual
void
OnRtpStreamUnhealthy
(
RTC
::
RtpStream
*
rtpStream
)
=
0
;
virtual
void
OnRtpStreamUnhealthy
(
RTC
::
RtpStream
*
rtpStream
)
=
0
;
};
};
...
@@ -50,6 +50,7 @@ namespace RTC
...
@@ -50,6 +50,7 @@ namespace RTC
const
RTC
::
RtpCodecMimeType
&
GetMimeType
()
const
;
const
RTC
::
RtpCodecMimeType
&
GetMimeType
()
const
;
float
GetLossPercentage
()
const
;
float
GetLossPercentage
()
const
;
bool
IsHealthy
()
const
;
bool
IsHealthy
()
const
;
void
SetUnhealthy
();
void
ResetHealthCheckTimer
(
uint16_t
timeout
=
HealthCheckPeriod
);
void
ResetHealthCheckTimer
(
uint16_t
timeout
=
HealthCheckPeriod
);
protected
:
protected
:
...
@@ -128,6 +129,11 @@ namespace RTC
...
@@ -128,6 +129,11 @@ namespace RTC
{
{
return
this
->
healthy
;
return
this
->
healthy
;
}
}
inline
void
RtpStream
::
SetUnhealthy
()
{
this
->
healthy
=
false
;
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/src/RTC/Consumer.cpp
浏览文件 @
b9532fcf
...
@@ -699,7 +699,7 @@ namespace RTC
...
@@ -699,7 +699,7 @@ namespace RTC
}
}
}
}
void
Consumer
::
OnRtpStream
Died
(
RtpStream
*
rtpStream
)
void
Consumer
::
OnRtpStream
Inactivity
(
RtpStream
*
rtpStream
)
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
b9532fcf
...
@@ -772,7 +772,7 @@ namespace RTC
...
@@ -772,7 +772,7 @@ namespace RTC
rtpStream
->
pliCount
++
;
rtpStream
->
pliCount
++
;
}
}
void
Producer
::
OnRtpStream
Died
(
RTC
::
RtpStream
*
rtpStream
)
void
Producer
::
OnRtpStream
Inactivity
(
RTC
::
RtpStream
*
rtpStream
)
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -782,10 +782,42 @@ namespace RTC
...
@@ -782,10 +782,42 @@ namespace RTC
this
->
mapRtpStreamProfiles
.
find
(
rtpStreamRecv
)
!=
this
->
mapRtpStreamProfiles
.
end
(),
this
->
mapRtpStreamProfiles
.
find
(
rtpStreamRecv
)
!=
this
->
mapRtpStreamProfiles
.
end
(),
"stream not present in mapRtpStreamProfiles"
);
"stream not present in mapRtpStreamProfiles"
);
MS_DEBUG_TAG
(
rtp
,
"stream is dead [ssrc:%"
PRIu32
"]"
,
rtpStream
->
GetSsrc
());
// Single healthy profile present. Ignore.
if
(
this
->
healthyProfiles
.
size
()
==
1
)
return
;
// Simulcast. Check whether any RTP is being received at all.
uint32_t
totalBitrate
=
0
;
uint64_t
now
=
DepLibUV
::
GetTime
();
for
(
auto
it
:
this
->
healthyProfiles
)
{
auto
healthyRtpStream
=
it
.
second
;
auto
ssrc
=
healthyRtpStream
->
GetSsrc
();
totalBitrate
+=
this
->
rtpStreams
[
ssrc
]
->
GetRate
(
now
);
}
// No RTP is being received at all. Ignore.
if
(
totalBitrate
==
0
)
return
;
// Simulcast. Remove the stream from healthy profiles.
MS_DEBUG_TAG
(
rtp
,
"rtp inactivity detected [ssrc:%"
PRIu32
,
rtpStream
->
GetSsrc
());
rtpStream
->
SetUnhealthy
();
RemoveHealthyProfiles
(
rtpStreamRecv
);
// Completely destroy the stream.
// Reset health check timer on every healthy stream.
ClearRtpStream
(
rtpStreamRecv
);
for
(
auto
it
:
this
->
healthyProfiles
)
{
auto
healthyRtpStream
=
it
.
second
;
auto
ssrc
=
healthyRtpStream
->
GetSsrc
();
this
->
rtpStreams
[
ssrc
]
->
ResetHealthCheckTimer
(
RTC
::
RtpStream
::
HealthCheckPeriod
*
2
);
}
}
}
void
Producer
::
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
void
Producer
::
OnRtpStreamHealthy
(
RTC
::
RtpStream
*
rtpStream
)
...
...
worker/src/RTC/RtpStreamRecv.cpp
浏览文件 @
b9532fcf
...
@@ -232,7 +232,7 @@ namespace RTC
...
@@ -232,7 +232,7 @@ namespace RTC
auto
now
=
DepLibUV
::
GetTime
();
auto
now
=
DepLibUV
::
GetTime
();
if
(
this
->
transmissionCounter
.
GetRate
(
now
)
==
0
)
if
(
this
->
transmissionCounter
.
GetRate
(
now
)
==
0
)
this
->
listener
->
OnRtpStream
Died
(
this
);
this
->
listener
->
OnRtpStream
Inactivity
(
this
);
}
}
void
RtpStreamRecv
::
OnNackGeneratorNackRequired
(
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
void
RtpStreamRecv
::
OnNackGeneratorNackRequired
(
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论