| 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_BASE_CLOCK_DRIFT_SMOOTHER_H_ | 5 #ifndef MEDIA_CAST_COMMON_CLOCK_DRIFT_SMOOTHER_H_ |
| 6 #define MEDIA_CAST_BASE_CLOCK_DRIFT_SMOOTHER_H_ | 6 #define MEDIA_CAST_COMMON_CLOCK_DRIFT_SMOOTHER_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 namespace cast { | 11 namespace cast { |
| 12 | 12 |
| 13 // Tracks the jitter and drift between clocks, providing a smoothed offset. | 13 // Tracks the jitter and drift between clocks, providing a smoothed offset. |
| 14 // Internally, a Simple IIR filter is used to maintain a running average that | 14 // Internally, a Simple IIR filter is used to maintain a running average that |
| 15 // moves at a rate based on the passage of time. | 15 // moves at a rate based on the passage of time. |
| 16 class ClockDriftSmoother { | 16 class ClockDriftSmoother { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 const base::TimeDelta time_constant_; | 44 const base::TimeDelta time_constant_; |
| 45 base::TimeTicks last_update_time_; | 45 base::TimeTicks last_update_time_; |
| 46 double estimate_us_; | 46 double estimate_us_; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace cast | 49 } // namespace cast |
| 50 } // namespace media | 50 } // namespace media |
| 51 | 51 |
| 52 #endif // MEDIA_CAST_BASE_CLOCK_DRIFT_SMOOTHER_H_ | 52 #endif // MEDIA_CAST_COMMON_CLOCK_DRIFT_SMOOTHER_H_ |
| OLD | NEW |