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

Some C++ rewording

上级 1a69e855
......@@ -14,8 +14,8 @@ namespace RTC
class Listener
{
public:
virtual void OnRembClientBitrateEstimation(
RTC::RembClient* rembClient, int32_t availableBitrate) = 0;
virtual void OnRembClientAvailableBandwidth(
RTC::RembClient* rembClient, int32_t availableBandwidth) = 0;
};
public:
......
......@@ -42,11 +42,11 @@ namespace RTC
class Listener
{
public:
// Called when a receive channel group has a new bitrate estimate for the incoming streams.
virtual void OnRembServerBitrateEstimation(
// Called when a receive channel group has a new bandwidth estimate for the incoming streams.
virtual void OnRembServerBandwidth(
const RemoteBitrateEstimator* remoteBitrateEstimator,
const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate) = 0;
uint32_t bandwidth) = 0;
};
protected:
......
......@@ -106,14 +106,14 @@ namespace RTC
/* Pure virtual methods inherited from RTC::RembClient::Listener. */
public:
void OnRembClientBitrateEstimation(RTC::RembClient* rembClient, int32_t availableBitrate) override;
void OnRembClientAvailableBandwidth(RTC::RembClient* rembClient, int32_t availableBandwidth) override;
/* Pure virtual methods inherited from RTC::RembServer::RemoteBitrateEstimator::Listener. */
public:
void OnRembServerBitrateEstimation(
void OnRembServerBandwidth(
const RTC::RembServer::RemoteBitrateEstimator* remoteBitrateEstimator,
const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate) override;
uint32_t bandwidth) override;
private:
// Allocated by this.
......
......@@ -323,7 +323,7 @@ namespace RTC
++this->totalProbesReceived;
// Make sure that a probe which updated the bitrate immediately has an
// effect by calling the OnRembServerBitrateEstimation callback.
// effect by calling the OnRembServerBandwidth callback.
if (ProcessClusters(nowMs) == ProbeResult::BITRATE_UPDATED)
updateEstimate = true;
}
......@@ -377,7 +377,7 @@ namespace RTC
this->lastUpdateMs = nowMs;
this->availableBitrate = targetBitrateBps;
this->observer->OnRembServerBitrateEstimation(this, ssrcs, targetBitrateBps);
this->observer->OnRembServerBandwidth(this, ssrcs, targetBitrateBps);
}
}
......
......@@ -165,7 +165,7 @@ namespace RTC
std::vector<uint32_t> ssrcs;
GetSsrcs(&ssrcs);
this->observer->OnRembServerBitrateEstimation(this, ssrcs, targetBitrate);
this->observer->OnRembServerBandwidth(this, ssrcs, targetBitrate);
}
}
......
......@@ -1413,28 +1413,28 @@ namespace RTC
// NOTE: No DataChannel support, si just ignore it.
}
inline void WebRtcTransport::OnRembClientBitrateEstimation(
RTC::RembClient* rembClient, int32_t availableBitrate)
inline void WebRtcTransport::OnRembClientAvailableBandwidth(
RTC::RembClient* rembClient, int32_t availableBandwidth)
{
MS_TRACE();
// TODO
}
inline void WebRtcTransport::OnRembServerBitrateEstimation(
inline void WebRtcTransport::OnRembServerBandwidth(
const RTC::RembServer::RemoteBitrateEstimator* /*rembServer*/,
const std::vector<uint32_t>& ssrcs,
uint32_t availableBitrate)
uint32_t bandwidth)
{
MS_TRACE();
uint32_t effectiveMaxBitrate{ 0u };
uint32_t effectiveBandwidth{ 0u };
// Limit announced available bitrate if requested via API.
// Limit announced bandwidth if requested via API.
if (this->maxIncomingBitrate != 0u)
effectiveMaxBitrate = std::min(availableBitrate, this->maxIncomingBitrate);
effectiveBandwidth = std::min(bandwidth, this->maxIncomingBitrate);
else
effectiveMaxBitrate = availableBitrate;
effectiveBandwidth = bandwidth;
if (MS_HAS_DEBUG_TAG(rbe))
{
......@@ -1448,15 +1448,15 @@ namespace RTC
MS_DEBUG_TAG(
rbe,
"sending RTCP REMB packet [available:%" PRIu32 "bps, effective:%" PRIu32 "bps, ssrcs:%s]",
availableBitrate,
effectiveMaxBitrate,
"sending RTCP REMB packet [bandwidth:%" PRIu32 "bps, effective:%" PRIu32 "bps, ssrcs:%s]",
bandwidth,
effectiveBandwidth,
ssrcsStream.str().c_str());
}
RTC::RTCP::FeedbackPsRembPacket packet(0, 0);
packet.SetBitrate(effectiveMaxBitrate);
packet.SetBitrate(effectiveBandwidth);
packet.SetSsrcs(ssrcs);
packet.Serialize(RTC::RTCP::Buffer);
SendRtcpPacket(&packet);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论