Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
47147afe
Unverified
提交
47147afe
authored
11月 16, 2022
作者:
Iñaki Baz Castillo
提交者:
GitHub
11月 16, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TransportCongestionControlClient: make usage of TrendCalculator for desired bitrate optional (#956)
上级
237fd62f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
26 行增加
和
2 行删除
+26
-2
TransportCongestionControlClient.cpp
worker/src/RTC/TransportCongestionControlClient.cpp
+26
-2
没有找到文件。
worker/src/RTC/TransportCongestionControlClient.cpp
浏览文件 @
47147afe
#define MS_CLASS "RTC::TransportCongestionControlClient"
#define MS_CLASS "RTC::TransportCongestionControlClient"
// #define MS_LOG_DEV_LEVEL 3
// #define MS_LOG_DEV_LEVEL 3
#define USE_TREND_CALCULATOR
#include "RTC/TransportCongestionControlClient.hpp"
#include "RTC/TransportCongestionControlClient.hpp"
#include "DepLibUV.hpp"
#include "DepLibUV.hpp"
...
@@ -111,12 +112,17 @@ namespace RTC
...
@@ -111,12 +112,17 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
#ifdef USE_TREND_CALCULATOR
auto
nowMs
=
DepLibUV
::
GetTimeMsInt64
();
auto
nowMs
=
DepLibUV
::
GetTimeMsInt64
();
#endif
this
->
bitrates
.
desiredBitrate
=
0u
;
this
->
bitrates
.
desiredBitrate
=
0u
;
this
->
bitrates
.
effectiveDesiredBitrate
=
0u
;
this
->
bitrates
.
effectiveDesiredBitrate
=
0u
;
#ifdef USE_TREND_CALCULATOR
this
->
desiredBitrateTrend
.
ForceUpdate
(
0u
,
nowMs
);
this
->
desiredBitrateTrend
.
ForceUpdate
(
0u
,
nowMs
);
#endif
this
->
rtpTransportControllerSend
->
OnNetworkAvailability
(
false
);
this
->
rtpTransportControllerSend
->
OnNetworkAvailability
(
false
);
}
}
...
@@ -279,17 +285,27 @@ namespace RTC
...
@@ -279,17 +285,27 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
#ifdef USE_TREND_CALCULATOR
auto
nowMs
=
DepLibUV
::
GetTimeMsInt64
();
auto
nowMs
=
DepLibUV
::
GetTimeMsInt64
();
#endif
// Manage it via trending and increase it a bit to avoid immediate oscillations.
// Manage it via trending and increase it a bit to avoid immediate oscillations.
#ifdef USE_TREND_CALCULATOR
if
(
!
force
)
if
(
!
force
)
this
->
desiredBitrateTrend
.
Update
(
desiredBitrate
,
nowMs
);
this
->
desiredBitrateTrend
.
Update
(
desiredBitrate
,
nowMs
);
else
else
this
->
desiredBitrateTrend
.
ForceUpdate
(
desiredBitrate
,
nowMs
);
this
->
desiredBitrateTrend
.
ForceUpdate
(
desiredBitrate
,
nowMs
);
#endif
this
->
bitrates
.
desiredBitrate
=
desiredBitrate
;
this
->
bitrates
.
desiredBitrate
=
desiredBitrate
;
#ifdef USE_TREND_CALCULATOR
this
->
bitrates
.
effectiveDesiredBitrate
=
this
->
desiredBitrateTrend
.
GetValue
();
this
->
bitrates
.
effectiveDesiredBitrate
=
this
->
desiredBitrateTrend
.
GetValue
();
this
->
bitrates
.
minBitrate
=
RTC
::
TransportCongestionControlMinOutgoingBitrate
;
#else
this
->
bitrates
.
effectiveDesiredBitrate
=
desiredBitrate
;
#endif
this
->
bitrates
.
minBitrate
=
RTC
::
TransportCongestionControlMinOutgoingBitrate
;
// NOTE: Setting 'startBitrate' to 'availableBitrate' has proven to generate
// NOTE: Setting 'startBitrate' to 'availableBitrate' has proven to generate
// more stable values.
// more stable values.
this
->
bitrates
.
startBitrate
=
std
::
max
<
uint32_t
>
(
this
->
bitrates
.
startBitrate
=
std
::
max
<
uint32_t
>
(
...
@@ -303,11 +319,19 @@ namespace RTC
...
@@ -303,11 +319,19 @@ namespace RTC
auto
currentMaxBitrate
=
this
->
bitrates
.
maxBitrate
;
auto
currentMaxBitrate
=
this
->
bitrates
.
maxBitrate
;
uint32_t
newMaxBitrate
=
0
;
uint32_t
newMaxBitrate
=
0
;
#ifdef USE_TREND_CALCULATOR
if
(
this
->
desiredBitrateTrend
.
GetValue
()
>
0u
)
if
(
this
->
desiredBitrateTrend
.
GetValue
()
>
0u
)
#else
if
(
this
->
bitrates
.
desiredBitrate
>
0u
)
#endif
{
{
newMaxBitrate
=
std
::
max
<
uint32_t
>
(
newMaxBitrate
=
std
::
max
<
uint32_t
>
(
this
->
initialAvailableBitrate
,
this
->
initialAvailableBitrate
,
#ifdef USE_TREND_CALCULATOR
this
->
desiredBitrateTrend
.
GetValue
()
*
MaxBitrateIncrementFactor
);
this
->
desiredBitrateTrend
.
GetValue
()
*
MaxBitrateIncrementFactor
);
#else
this
->
bitrates
.
desiredBitrate
*
MaxBitrateIncrementFactor
);
#endif
// If max bitrate requested didn't change by more than a small % keep the previous settings
// If max bitrate requested didn't change by more than a small % keep the previous settings
// to avoid constant small fluctuations requiring extra probing and making the estimation
// to avoid constant small fluctuations requiring extra probing and making the estimation
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论