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_SOURCE_H_ | 5 #ifndef MEDIA_BASE_TIME_SOURCE_H_ |
6 #define MEDIA_BASE_TIME_SOURCE_H_ | 6 #define MEDIA_BASE_TIME_SOURCE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Sets the media time to start ticking from. Only valid to call while the | 40 // Sets the media time to start ticking from. Only valid to call while the |
41 // time source is not ticking. | 41 // time source is not ticking. |
42 virtual void SetMediaTime(base::TimeDelta time) = 0; | 42 virtual void SetMediaTime(base::TimeDelta time) = 0; |
43 | 43 |
44 // Returns the current media timestamp relative to the timestamp set by | 44 // Returns the current media timestamp relative to the timestamp set by |
45 // SetMediaTime(). | 45 // SetMediaTime(). |
46 // | 46 // |
47 // Values returned are intended for informational purposes, such as displaying | 47 // Values returned are intended for informational purposes, such as displaying |
48 // UI with the current minute and second count. While it is guaranteed values | 48 // UI with the current minute and second count. While it is guaranteed values |
49 // will never go backwards, the frequency at which they update may be low. | 49 // will never go backwards, the frequency at which they update may be low. |
50 virtual base::TimeDelta CurrentMediaTime() = 0; | 50 virtual base::TimeDelta CurrentMediaTime(base::TimeTicks* reference) = 0; |
51 | 51 |
52 // Converts a vector of media timestamps into a vector of wall clock times; if | 52 // Converts a vector of media timestamps into a vector of wall clock times; if |
53 // the media time is stopped, returns false, otherwise returns true. Even if | 53 // the media time is stopped, returns false, otherwise returns true. Even if |
54 // time is stopped, timestamps will be converted. | 54 // time is stopped, timestamps will be converted. |
55 // | 55 // |
56 // Passing an empty |media_timestamps| vector will return the last known media | 56 // Passing an empty |media_timestamps| vector will return the last known media |
57 // time as a wall clock time. | 57 // time as a wall clock time. |
58 // | 58 // |
59 // Within a single call to GetWallClockTimes() the returned wall clock times | 59 // Within a single call to GetWallClockTimes() the returned wall clock times |
60 // are a strictly increasing function of the given media times. There is no | 60 // are a strictly increasing function of the given media times. There is no |
(...skipping 13 matching lines...) Expand all Loading... |
74 // guarantee is that the returned time will be less than the current wall | 74 // guarantee is that the returned time will be less than the current wall |
75 // clock time. | 75 // clock time. |
76 virtual bool GetWallClockTimes( | 76 virtual bool GetWallClockTimes( |
77 const std::vector<base::TimeDelta>& media_timestamps, | 77 const std::vector<base::TimeDelta>& media_timestamps, |
78 std::vector<base::TimeTicks>* wall_clock_times) = 0; | 78 std::vector<base::TimeTicks>* wall_clock_times) = 0; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace media | 81 } // namespace media |
82 | 82 |
83 #endif // MEDIA_BASE_TIME_SOURCE_H_ | 83 #endif // MEDIA_BASE_TIME_SOURCE_H_ |
OLD | NEW |