OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CLOCK_H_ | 5 #ifndef MEDIA_BASE_CLOCK_H_ |
6 #define MEDIA_BASE_CLOCK_H_ | 6 #define MEDIA_BASE_CLOCK_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void SetPlaybackRate(float playback_rate); | 49 void SetPlaybackRate(float playback_rate); |
50 | 50 |
51 // Forcefully sets the media time to |current_time|. The second parameter is | 51 // Forcefully sets the media time to |current_time|. The second parameter is |
52 // the |max_time| that the clock should progress after a call to Play(). This | 52 // the |max_time| that the clock should progress after a call to Play(). This |
53 // value is often the time of the end of the last frame buffered and decoded. | 53 // value is often the time of the end of the last frame buffered and decoded. |
54 // | 54 // |
55 // These values are clamped to the duration of the video, which is initially | 55 // These values are clamped to the duration of the video, which is initially |
56 // set to 0 (before SetDuration() is called). | 56 // set to 0 (before SetDuration() is called). |
57 void SetTime(base::TimeDelta current_time, base::TimeDelta max_time); | 57 void SetTime(base::TimeDelta current_time, base::TimeDelta max_time); |
58 | 58 |
59 // Sets the |max_time| to be returned by a call to Elapsed(). |max_time| must | 59 // Sets the |max_time| to be returned by a call to Elapsed(). |
60 // be greater than or equal to the current Elapsed() time. | |
61 void SetMaxTime(base::TimeDelta max_time); | 60 void SetMaxTime(base::TimeDelta max_time); |
62 | 61 |
63 // Returns the current elapsed media time. Returns 0 if SetDuration() has | 62 // Returns the current elapsed media time. Returns 0 if SetDuration() has |
64 // never been called. | 63 // never been called. |
65 base::TimeDelta Elapsed(); | 64 base::TimeDelta Elapsed(); |
66 | 65 |
67 // Sets the duration of the video. Clock expects the duration will be set | 66 // Sets the duration of the video. Clock expects the duration will be set |
68 // exactly once. | 67 // exactly once. |
69 void SetDuration(base::TimeDelta duration); | 68 void SetDuration(base::TimeDelta duration); |
70 | 69 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 122 |
124 // Duration of the media. | 123 // Duration of the media. |
125 base::TimeDelta duration_; | 124 base::TimeDelta duration_; |
126 | 125 |
127 DISALLOW_COPY_AND_ASSIGN(Clock); | 126 DISALLOW_COPY_AND_ASSIGN(Clock); |
128 }; | 127 }; |
129 | 128 |
130 } // namespace media | 129 } // namespace media |
131 | 130 |
132 #endif // MEDIA_BASE_CLOCK_H_ | 131 #endif // MEDIA_BASE_CLOCK_H_ |
OLD | NEW |