OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // A clock represent a single source of time to allow audio and video streams | 5 // A clock represent a single source of time to allow audio and video streams |
6 // to synchronize with each other. Clocks essentially track the media time with | 6 // to synchronize with each other. Clocks essentially track the media time with |
7 // respect to some other source of time, whether that may be the system clock, | 7 // respect to some other source of time, whether that may be the system clock, |
8 // audio hardware or some other OS-level API. | 8 // audio hardware or some other OS-level API. |
9 // | 9 // |
10 // Clocks start off paused with a playback rate of 1.0f and a media time of 0. | 10 // Clocks start off paused with a playback rate of 1.0f and a media time of 0. |
(...skipping 22 matching lines...) Expand all Loading... |
33 // Sets a new playback rate. The rate at which the media time will increase | 33 // Sets a new playback rate. The rate at which the media time will increase |
34 // will now change. | 34 // will now change. |
35 virtual void SetPlaybackRate(float playback_rate) = 0; | 35 virtual void SetPlaybackRate(float playback_rate) = 0; |
36 | 36 |
37 // Forcefully sets the media time to the given time. This should only be used | 37 // Forcefully sets the media time to the given time. This should only be used |
38 // where a discontinuity in the media is found (i.e., seeking). | 38 // where a discontinuity in the media is found (i.e., seeking). |
39 virtual void SetTime(const base::TimeDelta& time) = 0; | 39 virtual void SetTime(const base::TimeDelta& time) = 0; |
40 | 40 |
41 // Returns the current elapsed media time. | 41 // Returns the current elapsed media time. |
42 virtual base::TimeDelta Elapsed() const = 0; | 42 virtual base::TimeDelta Elapsed() const = 0; |
43 | |
44 protected: | |
45 ~Clock() {} | |
46 }; | 43 }; |
47 | 44 |
48 } // namespace media | 45 } // namespace media |
49 | 46 |
50 #endif // MEDIA_BASE_CLOCK_H_ | 47 #endif // MEDIA_BASE_CLOCK_H_ |
OLD | NEW |