Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/time_util.h

Issue 1491843004: [rtp_rtcp] RTT intermidiate calculation use ntp time instead of milliseconds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 23 matching lines...) Expand all
34 // ... 34 // ...
35 // In some fields where a more compact representation is 35 // In some fields where a more compact representation is
36 // appropriate, only the middle 32 bits are used; that is, the low 16 36 // appropriate, only the middle 32 bits are used; that is, the low 16
37 // bits of the integer part and the high 16 bits of the fractional part. 37 // bits of the integer part and the high 16 bits of the fractional part.
38 inline uint32_t CompactNtp(NtpTime ntp) { 38 inline uint32_t CompactNtp(NtpTime ntp) {
39 return (ntp.seconds() << 16) | (ntp.fractions() >> 16); 39 return (ntp.seconds() << 16) | (ntp.fractions() >> 16);
40 } 40 }
41 // Converts interval between compact ntp timestamps to milliseconds. 41 // Converts interval between compact ntp timestamps to milliseconds.
42 // This interval can be upto ~18.2 hours (2^16 seconds). 42 // This interval can be upto ~18.2 hours (2^16 seconds).
43 inline uint32_t CompactNtpIntervalToMs(uint32_t compact_ntp_interval) { 43 inline uint32_t CompactNtpIntervalToMs(uint32_t compact_ntp_interval) {
44 return static_cast<uint64_t>(compact_ntp_interval) * 1000 / (1 << 16); 44 uint64_t value = static_cast<uint64_t>(compact_ntp_interval);
45 return (value * 1000 + (1 << 15)) >> 16;
45 } 46 }
46 47
47 } // namespace webrtc 48 } // namespace webrtc
48 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_TIME_UTIL_H_ 49 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_TIME_UTIL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698