CongestionController::WrappingBitrateEstimator
RemoteBitrateEstimatorSingleStream
兼容以前老的基于延迟码率估算方式,接收端使用RemoteBitrateEstimatorSingleStream估算码率的,然后通过REMB反馈给发送端的
估算方式,跟发送端估算方式是一致的
这结构体,保存的基于延迟的码率估算的相关结构,
struct RemoteBitrateEstimatorSingleStream::Detector {
explicit Detector(int64_t last_packet_time_ms,
const OverUseDetectorOptions& options,
bool enable_burst_grouping)
: last_packet_time_ms(last_packet_time_ms),
inter_arrival(90 * kTimestampGroupLengthMs,
kTimestampToMs,
enable_burst_grouping),
estimator(options),
detector() {}
int64_t last_packet_time_ms;
InterArrival inter_arrival;
OveruseEstimator estimator;
OveruseDetector detector;
};
class RemoteBitrateEstimatorSingleStream{
//ssrc为key保存 Detector结构
typedef std::map<uint32_t, Detector*> SsrcOveruseEstimatorMap;
SsrcOveruseEstimatorMap overuse_detectors_ ;
//统计真实码率
RateStatistics incoming_bitrate_ ;
//基于OveruseDetector结果,进行码率控制,
std::unique_ptr<AimdRateControl> remote_rate
}