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

Side by Side Diff: webrtc/system_wrappers/include/rtp_to_ntp_estimator.h

Issue 2963133003: More gracefully handle rtp timestamp jumps in the rtp to ntp estimator. (Closed)
Patch Set: . Created 3 years, 5 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 | « no previous file | webrtc/system_wrappers/source/rtp_to_ntp_estimator.cc » ('j') | 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) 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
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_
OLDNEW
« no previous file with comments | « no previous file | webrtc/system_wrappers/source/rtp_to_ntp_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698