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

Side by Side Diff: media/cast/logging/receiver_time_offset_estimator_impl.h

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
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 <map> 8 #include <map>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 class BoundCalculator { 58 class BoundCalculator {
59 public: 59 public:
60 typedef std::pair<base::TimeTicks, base::TimeTicks> TimeTickPair; 60 typedef std::pair<base::TimeTicks, base::TimeTicks> TimeTickPair;
61 typedef std::map<uint64, TimeTickPair> EventMap; 61 typedef std::map<uint64, TimeTickPair> EventMap;
62 62
63 BoundCalculator(); 63 BoundCalculator();
64 ~BoundCalculator(); 64 ~BoundCalculator();
65 bool has_bound() const { return has_bound_; } 65 bool has_bound() const { return has_bound_; }
66 base::TimeDelta bound() const { return bound_; } 66 base::TimeDelta bound() const { return bound_; }
67 67
68 void SetSent(uint32 rtp, 68 void SetSent(RtpTimeTicks rtp,
69 uint32 packet_id, 69 uint16_t packet_id,
70 bool audio, 70 bool audio,
71 base::TimeTicks t); 71 base::TimeTicks t);
72 72
73 void SetReceived(uint32 rtp, 73 void SetReceived(RtpTimeTicks rtp,
74 uint16 packet_id, 74 uint16_t packet_id,
75 bool audio, 75 bool audio,
76 base::TimeTicks t); 76 base::TimeTicks t);
77 77
78 private: 78 private:
79 void UpdateBound(base::TimeTicks a, base::TimeTicks b); 79 void UpdateBound(base::TimeTicks a, base::TimeTicks b);
80 void CheckUpdate(uint64 key); 80 void CheckUpdate(uint64 key);
81 81
82 private: 82 private:
83 EventMap events_; 83 EventMap events_;
84 bool has_bound_; 84 bool has_bound_;
85 base::TimeDelta bound_; 85 base::TimeDelta bound_;
86 }; 86 };
87 87
88 // Fixed size storage to store event times for recent frames. 88 // Fixed size storage to store event times for recent frames.
89 BoundCalculator upper_bound_; 89 BoundCalculator upper_bound_;
90 BoundCalculator lower_bound_; 90 BoundCalculator lower_bound_;
91 91
92 base::ThreadChecker thread_checker_; 92 base::ThreadChecker thread_checker_;
93 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); 93 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl);
94 }; 94 };
95 95
96 } // namespace cast 96 } // namespace cast
97 } // namespace media 97 } // namespace media
98 98
99 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ 99 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698