mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
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}
This commit is contained in:
parent
83c726f3e5
commit
314b78d467
3 changed files with 2 additions and 7 deletions
|
@ -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 @@ bool RemoteNtpTimeEstimator::UpdateRtcpTimestamp(int64_t rtt,
|
|||
// 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;
|
||||
|
|
|
@ -45,11 +45,6 @@ class RTC_EXPORT Clock {
|
|||
// 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();
|
||||
};
|
||||
|
|
|
@ -56,7 +56,6 @@ TEST(NtpTimeTest, ToMsMeansToNtpMilliseconds) {
|
|||
SimulatedClock clock(0x123456789abc);
|
||||
|
||||
NtpTime ntp = clock.CurrentNtpTime();
|
||||
EXPECT_EQ(ntp.ToMs(), Clock::NtpToMs(ntp.seconds(), ntp.fractions()));
|
||||
EXPECT_EQ(ntp.ToMs(), clock.CurrentNtpInMilliseconds());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue