Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
295dbf6e
Unverified
提交
295dbf6e
authored
11月 04, 2022
作者:
Iñaki Baz Castillo
提交者:
GitHub
11月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ActiveSpeakerObserver: fix memory leak and more improvements (#942)
上级
0284e0ff
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
26 行增加
和
18 行删除
+26
-18
CHANGELOG.md
CHANGELOG.md
+1
-0
ActiveSpeakerObserver.hpp
worker/include/RTC/ActiveSpeakerObserver.hpp
+25
-18
ActiveSpeakerObserver.cpp
worker/src/RTC/ActiveSpeakerObserver.cpp
+0
-0
没有找到文件。
CHANGELOG.md
浏览文件 @
295dbf6e
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
*
Transport: Remove duplicate call to method (PR #931).
*
Transport: Remove duplicate call to method (PR #931).
*
RTCP: Adjust maximum compound packet size (PR #934).
*
RTCP: Adjust maximum compound packet size (PR #934).
*
Fix
`bufferedAmount`
type to be a number again (PR #936).
*
Fix
`bufferedAmount`
type to be a number again (PR #936).
*
`ActiveSpeakerObserver`
: Fix memory leak (PR #942).
### 3.10.12
### 3.10.12
...
...
worker/include/RTC/ActiveSpeakerObserver.hpp
浏览文件 @
295dbf6e
...
@@ -9,10 +9,9 @@
...
@@ -9,10 +9,9 @@
#include <vector>
#include <vector>
// Implementation of Dominant Speaker Identification for Multipoint
// Implementation of Dominant Speaker Identification for Multipoint
// Videoconferencing by Ilana Volfin and Israel Cohen. This
// Videoconferencing by Ilana Volfin and Israel Cohen. This implementation uses
// implementation uses the RTP Audio Level extension from RFC-6464
// the RTP Audio Level extension from RFC-6464 for the input signal. This has
// for the input signal.
// been ported from DominantSpeakerIdentification.java in Jitsi:
// This has been ported from DominantSpeakerIdentification.java in Jitsi.
// https://github.com/jitsi/jitsi-utils/blob/master/src/main/java/org/jitsi/utils/dsi/DominantSpeakerIdentification.java
// https://github.com/jitsi/jitsi-utils/blob/master/src/main/java/org/jitsi/utils/dsi/DominantSpeakerIdentification.java
namespace
RTC
namespace
RTC
{
{
...
@@ -24,7 +23,7 @@ namespace RTC
...
@@ -24,7 +23,7 @@ namespace RTC
public
:
public
:
Speaker
();
Speaker
();
void
EvalActivityScores
();
void
EvalActivityScores
();
double
GetActivityScore
(
int32
_t
interval
);
double
GetActivityScore
(
uint8
_t
interval
);
void
LevelChanged
(
uint32_t
level
,
uint64_t
now
);
void
LevelChanged
(
uint32_t
level
,
uint64_t
now
);
void
LevelTimedOut
(
uint64_t
now
);
void
LevelTimedOut
(
uint64_t
now
);
...
@@ -39,28 +38,36 @@ namespace RTC
...
@@ -39,28 +38,36 @@ namespace RTC
public
:
public
:
bool
paused
{
false
};
bool
paused
{
false
};
double
immediateActivityScore
;
double
immediateActivityScore
{
0
}
;
double
mediumActivityScore
;
double
mediumActivityScore
{
0
}
;
double
longActivityScore
;
double
longActivityScore
{
0
}
;
uint64_t
lastLevelChangeTime
{
0
};
uint64_t
lastLevelChangeTime
{
0
};
private
:
private
:
uint8_t
minLevel
;
uint8_t
minLevel
{
0u
}
;
uint8_t
nextMinLevel
;
uint8_t
nextMinLevel
{
0u
}
;
uint32_t
nextMinLevelWindowLen
{
0
};
uint32_t
nextMinLevelWindowLen
{
0
u
};
std
::
vector
<
uint8_t
>
immediates
;
std
::
vector
<
uint8_t
>
immediates
;
std
::
vector
<
uint8_t
>
mediums
;
std
::
vector
<
uint8_t
>
mediums
;
std
::
vector
<
uint8_t
>
longs
;
std
::
vector
<
uint8_t
>
longs
;
std
::
vector
<
uint8_t
>
levels
;
std
::
vector
<
uint8_t
>
levels
;
size_t
nextLevelIndex
;
size_t
nextLevelIndex
{
0u
}
;
};
};
struct
ProducerSpeaker
class
ProducerSpeaker
{
{
public
:
explicit
ProducerSpeaker
(
RTC
::
Producer
*
producer
);
~
ProducerSpeaker
();
public
:
RTC
::
Producer
*
producer
;
RTC
::
Producer
*
producer
;
Speaker
*
speaker
;
Speaker
*
speaker
;
};
};
private
:
static
const
size_t
RelativeSpeachActivitiesLen
{
3u
};
public
:
public
:
ActiveSpeakerObserver
(
const
std
::
string
&
id
,
RTC
::
RtpObserver
::
Listener
*
listener
,
json
&
data
);
ActiveSpeakerObserver
(
const
std
::
string
&
id
,
RTC
::
RtpObserver
::
Listener
*
listener
,
json
&
data
);
~
ActiveSpeakerObserver
()
override
;
~
ActiveSpeakerObserver
()
override
;
...
@@ -84,13 +91,13 @@ namespace RTC
...
@@ -84,13 +91,13 @@ namespace RTC
void
OnTimer
(
Timer
*
timer
)
override
;
void
OnTimer
(
Timer
*
timer
)
override
;
private
:
private
:
static
constexpr
int
relativeSpeachActivitiesLen
{
3
};
double
relativeSpeachActivities
[
RelativeSpeachActivitiesLen
];
double
relativeSpeachActivities
[
relativeSpeachActivitiesLen
];
std
::
string
dominantId
;
std
::
string
dominantId
{
""
};
Timer
*
periodicTimer
{
nullptr
};
Timer
*
periodicTimer
{
nullptr
};
uint16_t
interval
{
300u
};
uint16_t
interval
{
300u
};
absl
::
flat_hash_map
<
std
::
string
,
struct
ProducerSpeaker
>
mapProducerSpeaker
;
// Map of ProducerSpeakers indexed by Producer id.
uint64_t
lastLevelIdleTime
{
0
};
absl
::
flat_hash_map
<
std
::
string
,
ProducerSpeaker
*>
mapProducerSpeakers
;
uint64_t
lastLevelIdleTime
{
0u
};
};
};
}
// namespace RTC
}
// namespace RTC
...
...
worker/src/RTC/ActiveSpeakerObserver.cpp
浏览文件 @
295dbf6e
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论