Remove WebRTC-ClockEstimation experiment and make new clock estimation always enabled
Bug: webrtc:8468 Change-Id: Id9feb8e2c015f0a895a093d20caedae4a8b1337e Reviewed-on: https://webrtc-review.googlesource.com/29161 Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21075}
This commit is contained in:
committed by
Commit Bot
parent
b32c473770
commit
33102745a0
@ -20,7 +20,6 @@
|
||||
namespace webrtc {
|
||||
|
||||
class Clock;
|
||||
class TimestampExtrapolator;
|
||||
|
||||
// RemoteNtpTimeEstimator can be used to estimate a given RTP timestamp's NTP
|
||||
// time in local timebase.
|
||||
@ -43,11 +42,9 @@ class RemoteNtpTimeEstimator {
|
||||
|
||||
private:
|
||||
Clock* clock_;
|
||||
std::unique_ptr<TimestampExtrapolator> ts_extrapolator_;
|
||||
MovingMedianFilter<int64_t> ntp_clocks_offset_estimator_;
|
||||
RtpToNtpEstimator rtp_to_ntp_;
|
||||
int64_t last_timing_log_ms_;
|
||||
const bool is_experiment_enabled_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RemoteNtpTimeEstimator);
|
||||
};
|
||||
|
||||
|
||||
@ -12,8 +12,6 @@
|
||||
|
||||
#include "rtc_base/logging.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
#include "system_wrappers/include/timestamp_extrapolator.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -21,19 +19,14 @@ namespace {
|
||||
static const int kTimingLogIntervalMs = 10000;
|
||||
static const int kClocksOffsetSmoothingWindow = 100;
|
||||
|
||||
bool IsClockEstimationExperimentEnabled() {
|
||||
return webrtc::field_trial::IsEnabled("WebRTC-ClockEstimation");
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// TODO(wu): Refactor this class so that it can be shared with
|
||||
// vie_sync_module.cc.
|
||||
RemoteNtpTimeEstimator::RemoteNtpTimeEstimator(Clock* clock)
|
||||
: clock_(clock),
|
||||
ts_extrapolator_(new TimestampExtrapolator(clock_->TimeInMilliseconds())),
|
||||
ntp_clocks_offset_estimator_(kClocksOffsetSmoothingWindow),
|
||||
last_timing_log_ms_(-1),
|
||||
is_experiment_enabled_(IsClockEstimationExperimentEnabled()) {}
|
||||
last_timing_log_ms_(-1) {}
|
||||
|
||||
RemoteNtpTimeEstimator::~RemoteNtpTimeEstimator() {}
|
||||
|
||||
@ -55,9 +48,6 @@ bool RemoteNtpTimeEstimator::UpdateRtcpTimestamp(int64_t rtt,
|
||||
// The extrapolator assumes the TimeInMilliseconds time.
|
||||
int64_t receiver_arrival_time_ms = clock_->TimeInMilliseconds();
|
||||
int64_t sender_send_time_ms = Clock::NtpToMs(ntp_secs, ntp_frac);
|
||||
int64_t sender_arrival_time_90k = (sender_send_time_ms + rtt / 2) * 90;
|
||||
ts_extrapolator_->Update(receiver_arrival_time_ms, sender_arrival_time_90k);
|
||||
|
||||
int64_t sender_arrival_time_ms = sender_send_time_ms + rtt / 2;
|
||||
int64_t remote_to_local_clocks_offset =
|
||||
receiver_arrival_time_ms - sender_arrival_time_ms;
|
||||
@ -71,16 +61,10 @@ int64_t RemoteNtpTimeEstimator::Estimate(uint32_t rtp_timestamp) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int64_t receiver_capture_ms;
|
||||
|
||||
if (is_experiment_enabled_) {
|
||||
int64_t remote_to_local_clocks_offset =
|
||||
ntp_clocks_offset_estimator_.GetFilteredValue();
|
||||
receiver_capture_ms = sender_capture_ntp_ms + remote_to_local_clocks_offset;
|
||||
} else {
|
||||
uint32_t timestamp = sender_capture_ntp_ms * 90;
|
||||
receiver_capture_ms = ts_extrapolator_->ExtrapolateLocalTime(timestamp);
|
||||
}
|
||||
int64_t remote_to_local_clocks_offset =
|
||||
ntp_clocks_offset_estimator_.GetFilteredValue();
|
||||
int64_t receiver_capture_ms =
|
||||
sender_capture_ntp_ms + remote_to_local_clocks_offset;
|
||||
int64_t now_ms = clock_->TimeInMilliseconds();
|
||||
int64_t ntp_offset = clock_->CurrentNtpInMilliseconds() - now_ms;
|
||||
int64_t receiver_capture_ntp_ms = receiver_capture_ms + ntp_offset;
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#include "modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "system_wrappers/include/clock.h"
|
||||
#include "test/field_trial.h"
|
||||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
@ -108,11 +107,6 @@ TEST_F(RemoteNtpTimeEstimatorTest, Estimate) {
|
||||
}
|
||||
|
||||
TEST_F(RemoteNtpTimeEstimatorTest, AveragesErrorsOut) {
|
||||
test::ScopedFieldTrials override_field_trials(
|
||||
"WebRTC-ClockEstimation/Enabled/");
|
||||
// Reset estimator_ because it checks experiment status during construction.
|
||||
estimator_.reset(new RemoteNtpTimeEstimator(&local_clock_));
|
||||
|
||||
// Remote peer sends first 5 RTCP SR without errors.
|
||||
AdvanceTimeMilliseconds(1000);
|
||||
SendRtcpSr();
|
||||
|
||||
Reference in New Issue
Block a user