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

Some C++ rewording

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