webrtc中Transport-CC带宽计算流程

相关对象之间所属关系
Call
  |
  ---RtpTransportControllerSend
  			|
  			---SendSideCongestionController
  					|
  					---BitrateControllerImp
  					|			|
  			        |			---SendSideBandwidthEstimation(负责最终的带宽的确定工作)
  					|
  					---DelaybaseBwe(包装Trendline滤波器)


SendSideBandwidthEstimation : 计算并存储最终码率,如果是gcc同样存放远端计算的码率(即通过TMMBR、REMB传过来的)
	|
	---void UpdateEstimate(int64_t now_ms) : 在Proccess中周期性调用,进行当前最新码率的计算
	|
	---void UpdateDelayBasedEstimate(int64_t now_ms, uint32_t bitrate_bps) : 根据DelaybaseBwe计算的结果计算当前码率
	|
	---void UpdatePacketsLost(int packets_lost, ...) : 更新丢包率
	|
	---void UpdateRtt(int64_t rtt, int64_t now_ms) : 更新RTT
	|
	---void CurrentEstimate(int* bitrate, uint8_t* loss, int64_t* rtt) : 上层通过这接口获取当前码率从而进行pacer及编码器码率的设置


BitrateControllerImp : 是SendSideBandwidthEstimation的包装,同样还负责RR报文的解析
	|
	---void OnDelayBasedBweResult(const DelayBasedBwe::Result& result) : 通过这个接口将DelaybaseBwe计算的结果存放到SendSideBandwidthEstimation中
	|
	---void Process() : 调用SendSideBandwidthEstimation的UpdateEstimate及CurrentEstimate接口,并将计算好的带宽通知给观察者
	|
	---void OnReceivedRtcpReceiverReport(...) : rtp/rtcp模块调用


基于丢包 RR报文
RTCPReceiver::IncomingPacket
	|
RTCPReceiver::TriggerCallbacksFromRtcpPacket
	|
BitrateControllerImpl::OnReceivedRtcpReceiverReport
	|
SendSideBandwidthEstimation::UpdateReceiverBlock
	|
SendSideBandwidthEstimation::UpdatePacketsLost
	|
SendSideBandwidthEstimation::UpdateEstimate
	|
SendSideBandwidthEstimation::CapBitrateToThresholds
	|
current_bitrate_bps_ = bitrate_bps;


基于延时 TransportFeedback报文
RTCPReceiver::IncomingPacket
	|
RTCPReceiver::TriggerCallbacksFromRtcpPacket
	|
SendSideCongestionController::OnTransportFeedback
	|
BitrateControllerImpl::OnDelayBasedBweResult
	|
SendSideBandwidthEstimation::UpdateDelayBasedEstimate
	|
SendSideBandwidthEstimation::CapBitrateToThresholds
	|
current_bitrate_bps_ = bitrate_bps;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

airmanisvip

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值