OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 5 #ifndef MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
6 #define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 6 #define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 class BoundCalculator { | 62 class BoundCalculator { |
63 public: | 63 public: |
64 typedef std::pair<base::TimeTicks, base::TimeTicks> TimeTickPair; | 64 typedef std::pair<base::TimeTicks, base::TimeTicks> TimeTickPair; |
65 typedef std::map<uint64_t, TimeTickPair> EventMap; | 65 typedef std::map<uint64_t, TimeTickPair> EventMap; |
66 | 66 |
67 BoundCalculator(); | 67 BoundCalculator(); |
68 ~BoundCalculator(); | 68 ~BoundCalculator(); |
69 bool has_bound() const { return has_bound_; } | 69 bool has_bound() const { return has_bound_; } |
70 base::TimeDelta bound() const { return bound_; } | 70 base::TimeDelta bound() const { return bound_; } |
71 | 71 |
72 void SetSent(uint32_t rtp, | 72 void SetSent(RtpTimeTicks rtp, |
73 uint32_t packet_id, | 73 uint16_t packet_id, |
74 bool audio, | 74 bool audio, |
75 base::TimeTicks t); | 75 base::TimeTicks t); |
76 | 76 |
77 void SetReceived(uint32_t rtp, | 77 void SetReceived(RtpTimeTicks rtp, |
78 uint16_t packet_id, | 78 uint16_t packet_id, |
79 bool audio, | 79 bool audio, |
80 base::TimeTicks t); | 80 base::TimeTicks t); |
81 | 81 |
82 private: | 82 private: |
83 void UpdateBound(base::TimeTicks a, base::TimeTicks b); | 83 void UpdateBound(base::TimeTicks a, base::TimeTicks b); |
84 void CheckUpdate(uint64_t key); | 84 void CheckUpdate(uint64_t key); |
85 | 85 |
86 private: | 86 private: |
87 EventMap events_; | 87 EventMap events_; |
88 bool has_bound_; | 88 bool has_bound_; |
89 base::TimeDelta bound_; | 89 base::TimeDelta bound_; |
90 }; | 90 }; |
91 | 91 |
92 // Fixed size storage to store event times for recent frames. | 92 // Fixed size storage to store event times for recent frames. |
93 BoundCalculator upper_bound_; | 93 BoundCalculator upper_bound_; |
94 BoundCalculator lower_bound_; | 94 BoundCalculator lower_bound_; |
95 | 95 |
96 base::ThreadChecker thread_checker_; | 96 base::ThreadChecker thread_checker_; |
97 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); | 97 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace cast | 100 } // namespace cast |
101 } // namespace media | 101 } // namespace media |
102 | 102 |
103 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 103 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
OLD | NEW |