Put send-side bwe probing under finch experiment.
BUG=crbug/425925 R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/26079004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7668 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/field_trial.h"
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
#include "webrtc/system_wrappers/interface/metrics.h"
|
||||
|
||||
@ -103,6 +104,9 @@ void SendSideBandwidthEstimation::UpdateReceiverBlock(uint8_t fraction_loss,
|
||||
uint32_t rtt,
|
||||
int number_of_packets,
|
||||
uint32_t now_ms) {
|
||||
if (first_report_time_ms_ == -1)
|
||||
first_report_time_ms_ = now_ms;
|
||||
|
||||
// Update RTT.
|
||||
last_round_trip_time_ms_ = rtt;
|
||||
|
||||
@ -129,12 +133,7 @@ void SendSideBandwidthEstimation::UpdateReceiverBlock(uint8_t fraction_loss,
|
||||
}
|
||||
time_last_receiver_block_ms_ = now_ms;
|
||||
UpdateEstimate(now_ms);
|
||||
|
||||
if (first_report_time_ms_ == -1) {
|
||||
first_report_time_ms_ = now_ms;
|
||||
} else {
|
||||
UpdateUmaStats(now_ms, rtt, (fraction_loss * number_of_packets) >> 8);
|
||||
}
|
||||
UpdateUmaStats(now_ms, rtt, (fraction_loss * number_of_packets) >> 8);
|
||||
}
|
||||
|
||||
void SendSideBandwidthEstimation::UpdateUmaStats(int64_t now_ms,
|
||||
@ -167,12 +166,14 @@ void SendSideBandwidthEstimation::UpdateUmaStats(int64_t now_ms,
|
||||
void SendSideBandwidthEstimation::UpdateEstimate(uint32_t now_ms) {
|
||||
// We trust the REMB during the first 2 seconds if we haven't had any
|
||||
// packet loss reported, to allow startup bitrate probing.
|
||||
if (last_fraction_loss_ == 0 && IsInStartPhase(now_ms) &&
|
||||
bwe_incoming_ > bitrate_) {
|
||||
bitrate_ = CapBitrateToThresholds(bwe_incoming_);
|
||||
min_bitrate_history_.clear();
|
||||
min_bitrate_history_.push_back(std::make_pair(now_ms, bitrate_));
|
||||
return;
|
||||
if (ProbingExperimentIsEnabled()) {
|
||||
if (last_fraction_loss_ == 0 && IsInStartPhase(now_ms) &&
|
||||
bwe_incoming_ > bitrate_) {
|
||||
bitrate_ = CapBitrateToThresholds(bwe_incoming_);
|
||||
min_bitrate_history_.clear();
|
||||
min_bitrate_history_.push_back(std::make_pair(now_ms, bitrate_));
|
||||
return;
|
||||
}
|
||||
}
|
||||
UpdateMinHistory(now_ms);
|
||||
// Only start updating bitrate when receiving receiver blocks.
|
||||
@ -265,4 +266,8 @@ uint32_t SendSideBandwidthEstimation::CapBitrateToThresholds(uint32_t bitrate) {
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
bool SendSideBandwidthEstimation::ProbingExperimentIsEnabled() const {
|
||||
return webrtc::field_trial::FindFullName("WebRTC-BitrateProbing") ==
|
||||
"Enabled";
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user