OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 uint32_t ntp_frac, | 47 uint32_t ntp_frac, |
48 uint32_t rtp_timestamp, | 48 uint32_t rtp_timestamp, |
49 bool* new_rtcp_sr); | 49 bool* new_rtcp_sr); |
50 | 50 |
51 // Converts an RTP timestamp to the NTP domain in milliseconds. | 51 // Converts an RTP timestamp to the NTP domain in milliseconds. |
52 // Returns true on success, false otherwise. | 52 // Returns true on success, false otherwise. |
53 bool Estimate(int64_t rtp_timestamp, int64_t* rtp_timestamp_ms) const; | 53 bool Estimate(int64_t rtp_timestamp, int64_t* rtp_timestamp_ms) const; |
54 | 54 |
55 const Parameters& params() const { return params_; } | 55 const Parameters& params() const { return params_; } |
56 | 56 |
| 57 static const int kMaxInvalidSamples = 3; |
| 58 |
57 private: | 59 private: |
58 void UpdateParameters(); | 60 void UpdateParameters(); |
59 | 61 |
| 62 int consecutive_invalid_samples_; |
60 std::list<RtcpMeasurement> measurements_; | 63 std::list<RtcpMeasurement> measurements_; |
61 Parameters params_; | 64 Parameters params_; |
62 }; | 65 }; |
63 | 66 |
64 // Returns: | 67 // Returns: |
65 // 1: forward wrap around. | 68 // 1: forward wrap around. |
66 // 0: no wrap around. | 69 // 0: no wrap around. |
67 // -1: backwards wrap around (i.e. reordering). | 70 // -1: backwards wrap around (i.e. reordering). |
68 int CheckForWrapArounds(uint32_t new_timestamp, uint32_t old_timestamp); | 71 int CheckForWrapArounds(uint32_t new_timestamp, uint32_t old_timestamp); |
69 | 72 |
70 } // namespace webrtc | 73 } // namespace webrtc |
71 | 74 |
72 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_RTP_TO_NTP_ESTIMATOR_H_ | 75 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_RTP_TO_NTP_ESTIMATOR_H_ |
OLD | NEW |