OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_ |
13 | 13 |
| 14 #include <memory> |
| 15 |
14 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
15 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
16 #include "webrtc/system_wrappers/include/rtp_to_ntp.h" | 18 #include "webrtc/system_wrappers/include/rtp_to_ntp.h" |
17 | 19 |
18 namespace webrtc { | 20 namespace webrtc { |
19 | 21 |
20 class Clock; | 22 class Clock; |
21 class TimestampExtrapolator; | 23 class TimestampExtrapolator; |
22 | 24 |
23 // RemoteNtpTimeEstimator can be used to estimate a given RTP timestamp's NTP | 25 // RemoteNtpTimeEstimator can be used to estimate a given RTP timestamp's NTP |
(...skipping 10 matching lines...) Expand all Loading... |
34 // NTP fraction |ntp_frac| and RTP timestamp |rtcp_timestamp|. | 36 // NTP fraction |ntp_frac| and RTP timestamp |rtcp_timestamp|. |
35 bool UpdateRtcpTimestamp(int64_t rtt, uint32_t ntp_secs, uint32_t ntp_frac, | 37 bool UpdateRtcpTimestamp(int64_t rtt, uint32_t ntp_secs, uint32_t ntp_frac, |
36 uint32_t rtp_timestamp); | 38 uint32_t rtp_timestamp); |
37 | 39 |
38 // Estimates the NTP timestamp in local timebase from |rtp_timestamp|. | 40 // Estimates the NTP timestamp in local timebase from |rtp_timestamp|. |
39 // Returns the NTP timestamp in ms when success. -1 if failed. | 41 // Returns the NTP timestamp in ms when success. -1 if failed. |
40 int64_t Estimate(uint32_t rtp_timestamp); | 42 int64_t Estimate(uint32_t rtp_timestamp); |
41 | 43 |
42 private: | 44 private: |
43 Clock* clock_; | 45 Clock* clock_; |
44 rtc::scoped_ptr<TimestampExtrapolator> ts_extrapolator_; | 46 std::unique_ptr<TimestampExtrapolator> ts_extrapolator_; |
45 RtcpList rtcp_list_; | 47 RtcpList rtcp_list_; |
46 int64_t last_timing_log_ms_; | 48 int64_t last_timing_log_ms_; |
47 RTC_DISALLOW_COPY_AND_ASSIGN(RemoteNtpTimeEstimator); | 49 RTC_DISALLOW_COPY_AND_ASSIGN(RemoteNtpTimeEstimator); |
48 }; | 50 }; |
49 | 51 |
50 } // namespace webrtc | 52 } // namespace webrtc |
51 | 53 |
52 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_ | 54 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_ |
OLD | NEW |