/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef SYSTEM_WRAPPERS_INCLUDE_NTP_TIME_H_ #define SYSTEM_WRAPPERS_INCLUDE_NTP_TIME_H_ #include <cmath> #include <cstdint> #include <limits> #include "rtc_base/numerics/safe_conversions.h" namespace webrtc { class NtpTime { … }; inline bool operator==(const NtpTime& n1, const NtpTime& n2) { … } inline bool operator!=(const NtpTime& n1, const NtpTime& n2) { … } // Converts `int64_t` milliseconds to Q32.32-formatted fixed-point seconds. // Performs clamping if the result overflows or underflows. inline int64_t Int64MsToQ32x32(int64_t milliseconds) { … } // Converts `int64_t` milliseconds to UQ32.32-formatted fixed-point seconds. // Performs clamping if the result overflows or underflows. inline uint64_t Int64MsToUQ32x32(int64_t milliseconds) { … } // Converts Q32.32-formatted fixed-point seconds to `int64_t` milliseconds. inline int64_t Q32x32ToInt64Ms(int64_t q32x32) { … } // Converts UQ32.32-formatted fixed-point seconds to `int64_t` milliseconds. inline int64_t UQ32x32ToInt64Ms(uint64_t q32x32) { … } } // namespace webrtc #endif // SYSTEM_WRAPPERS_INCLUDE_NTP_TIME_H_