Remove `Clock::NtpToMs`.
This helper method does not belong to the Clock class. Also, it's simple enough that it's not needed.
Bug: webrtc:11327
Change-Id: I95a33f08fd568b293b591171ecaf5e7aef8d413c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214123
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/master@{#33652}
diff --git a/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc b/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
index 6fed731..131118f 100644
--- a/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
+++ b/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
@@ -15,6 +15,7 @@
#include "modules/rtp_rtcp/source/time_util.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/clock.h"
+#include "system_wrappers/include/ntp_time.h"
namespace webrtc {
@@ -53,7 +54,7 @@
// The extrapolator assumes the ntp time.
int64_t receiver_arrival_time_ms =
clock_->TimeInMilliseconds() + NtpOffsetMs();
- int64_t sender_send_time_ms = Clock::NtpToMs(ntp_secs, ntp_frac);
+ int64_t sender_send_time_ms = NtpTime(ntp_secs, ntp_frac).ToMs();
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;
diff --git a/system_wrappers/include/clock.h b/system_wrappers/include/clock.h
index 3c60f63..f70a2f4 100644
--- a/system_wrappers/include/clock.h
+++ b/system_wrappers/include/clock.h
@@ -45,11 +45,6 @@
// Retrieve an NTP absolute timestamp in milliseconds.
virtual int64_t CurrentNtpInMilliseconds() = 0;
- // Converts an NTP timestamp to a millisecond timestamp.
- static int64_t NtpToMs(uint32_t seconds, uint32_t fractions) {
- return NtpTime(seconds, fractions).ToMs();
- }
-
// Returns an instance of the real-time system clock implementation.
static Clock* GetRealTimeClock();
};
diff --git a/system_wrappers/source/ntp_time_unittest.cc b/system_wrappers/source/ntp_time_unittest.cc
index cdaca67..0705531 100644
--- a/system_wrappers/source/ntp_time_unittest.cc
+++ b/system_wrappers/source/ntp_time_unittest.cc
@@ -56,7 +56,6 @@
SimulatedClock clock(0x123456789abc);
NtpTime ntp = clock.CurrentNtpTime();
- EXPECT_EQ(ntp.ToMs(), Clock::NtpToMs(ntp.seconds(), ntp.fractions()));
EXPECT_EQ(ntp.ToMs(), clock.CurrentNtpInMilliseconds());
}