Revert "Migrate RemoteNtpTimeEstimator to more precise time representations"

This reverts commit a154a15c978a0eae133d957dcad3581fd5f98c7b.

Reason for revert: breaks downstream tests

Original change's description:
> Migrate RemoteNtpTimeEstimator to more precise time representations
>
> Bug: webrtc:13757
> Change-Id: I880ab3cc6e4f72da587ae42ddca051332907c07f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261311
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36817}

Bug: webrtc:13757
Change-Id: Id21edb1378e6e944b24955396250ddc33fa70663
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261722
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36819}
This commit is contained in:
Danil Chapovalov
2022-05-09 15:40:05 +00:00
committed by WebRTC LUCI CQ
parent cb7c7366d0
commit 853a407273
9 changed files with 117 additions and 171 deletions

View File

@ -95,20 +95,4 @@ TEST(TimeUtilTest, SaturatedToCompactNtp) {
5'515, 16);
}
TEST(TimeUtilTest, ToNtpUnits) {
EXPECT_EQ(ToNtpUnits(TimeDelta::Zero()), 0);
EXPECT_EQ(ToNtpUnits(TimeDelta::Seconds(1)), int64_t{1} << 32);
EXPECT_EQ(ToNtpUnits(TimeDelta::Seconds(-1)), -(int64_t{1} << 32));
EXPECT_EQ(ToNtpUnits(TimeDelta::Millis(500)), int64_t{1} << 31);
EXPECT_EQ(ToNtpUnits(TimeDelta::Millis(-1'500)), -(int64_t{3} << 31));
// Smallest TimeDelta that can be converted without precision loss.
EXPECT_EQ(ToNtpUnits(TimeDelta::Micros(15'625)), int64_t{1} << 26);
// 1 us ~= 4'294.97 NTP units. ToNtpUnits makes no rounding promises.
EXPECT_GE(ToNtpUnits(TimeDelta::Micros(1)), 4'294);
EXPECT_LE(ToNtpUnits(TimeDelta::Micros(1)), 4'295);
}
} // namespace webrtc