Chromium Code Reviews| 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_BASE_TIME_DELTA_INTERPOLATOR_H_ | 5 #ifndef MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ |
| 6 #define MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ | 6 #define MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 // Sets a new rate at which to interpolate. | 42 // Sets a new rate at which to interpolate. |
| 43 // | 43 // |
| 44 // |tick_clock| will be queried for a new reference time value. | 44 // |tick_clock| will be queried for a new reference time value. |
| 45 void SetPlaybackRate(double playback_rate); | 45 void SetPlaybackRate(double playback_rate); |
| 46 | 46 |
| 47 // Sets the two timestamps to interpolate between at |playback_rate_|. | 47 // Sets the two timestamps to interpolate between at |playback_rate_|. |
| 48 // |upper_bound| must be greater or equal to |lower_bound|. | 48 // |upper_bound| must be greater or equal to |lower_bound|. |
| 49 // | 49 // |
| 50 // |upper_bound| is typically the media timestamp of the last audio frame | 50 // |upper_bound| is typically the media timestamp of the last audio frame |
| 51 // buffered by the audio hardware. | 51 // buffered by the audio hardware. |
| 52 void SetBounds(base::TimeDelta lower_bound, base::TimeDelta upper_bound); | 52 void SetBounds(base::TimeDelta lower_bound, |
| 53 base::TimeDelta upper_bound, | |
| 54 base::TimeTicks capture_time); | |
|
alokp
2016/09/02 22:51:17
Added to avoid calling TimeTicks::Now multiple tim
| |
| 53 | 55 |
| 54 // Sets the upper bound used for interpolation. Note that if |upper_bound| is | 56 // Sets the upper bound used for interpolation. Note that if |upper_bound| is |
| 55 // less than what was previously set via SetTime(), then all future calls | 57 // less than what was previously set via SetTime(), then all future calls |
| 56 // to GetInterpolatedTime() will return |upper_bound|. | 58 // to GetInterpolatedTime() will return |upper_bound|. |
| 57 void SetUpperBound(base::TimeDelta upper_bound); | 59 void SetUpperBound(base::TimeDelta upper_bound); |
| 58 | 60 |
| 59 // Computes an interpolated time based on SetTime(). | 61 // Computes an interpolated time based on SetTime(). |
| 60 base::TimeDelta GetInterpolatedTime(); | 62 base::TimeDelta GetInterpolatedTime(); |
| 61 | 63 |
| 62 private: | 64 private: |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 73 base::TimeTicks reference_; | 75 base::TimeTicks reference_; |
| 74 | 76 |
| 75 double playback_rate_; | 77 double playback_rate_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(TimeDeltaInterpolator); | 79 DISALLOW_COPY_AND_ASSIGN(TimeDeltaInterpolator); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace media | 82 } // namespace media |
| 81 | 83 |
| 82 #endif // MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ | 84 #endif // MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ |
| OLD | NEW |