提交 69168858 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

RembClient: emit the event fast if we detect a high REMB value decrease

上级 9af4067c
...@@ -38,7 +38,9 @@ namespace RTC ...@@ -38,7 +38,9 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
uint64_t now = DepLibUV::GetTime(); auto previousAvailableBitrate = this->availableBitrate;
uint64_t now = DepLibUV::GetTime();
bool notify{ false };
CheckStatus(now); CheckStatus(now);
...@@ -65,13 +67,30 @@ namespace RTC ...@@ -65,13 +67,30 @@ namespace RTC
// Emit event if EventInterval elapsed. // Emit event if EventInterval elapsed.
if (now - this->lastEventAt >= EventInterval) if (now - this->lastEventAt >= EventInterval)
{ {
this->lastEventAt = now; notify = true;
}
this->listener->OnRembClientAvailableBitrate(this, this->availableBitrate); // Also emit the event fast if we detect a high REMB value decrease.
else if (this->availableBitrate < previousAvailableBitrate * 0.75)
{
MS_WARN_TAG(
bwe,
"high REMB value decrease detected, notifying the listener [before:%" PRIu32
", now:%" PRIu32 "]",
previousAvailableBitrate,
this->availableBitrate);
notify = true;
} }
// Pass available bitrate to the RtpProbator. // Pass available bitrate to the RtpProbator.
this->rtpProbator->UpdateAvailableBitrate(this->availableBitrate); this->rtpProbator->UpdateAvailableBitrate(this->availableBitrate);
if (notify)
{
this->lastEventAt = now;
this->listener->OnRembClientAvailableBitrate(this, this->availableBitrate);
}
} }
void RembClient::SentRtpPacket(RTC::RtpPacket* packet, bool retransmitted) void RembClient::SentRtpPacket(RTC::RtpPacket* packet, bool retransmitted)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论