OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_BASE_TIME_SOURCE_H_ |
| 6 #define MEDIA_BASE_TIME_SOURCE_H_ |
| 7 |
| 8 #include "base/time/time.h" |
| 9 #include "media/base/media_export.h" |
| 10 |
| 11 namespace media { |
| 12 |
| 13 // A TimeSource is capable of providing the current media time. |
| 14 class MEDIA_EXPORT TimeSource { |
| 15 public: |
| 16 TimeSource() {} |
| 17 virtual ~TimeSource() {} |
| 18 |
| 19 // Signal the time source to start ticking. It is expected that values from |
| 20 // CurrentMediaTime() will start increasing. |
| 21 virtual void StartTicking() = 0; |
| 22 |
| 23 // Signal the time source to stop ticking. It is expected that values from |
| 24 // CurrentMediaTime() will remain constant. |
| 25 virtual void StopTicking() = 0; |
| 26 |
| 27 // Updates the current playback rate. It is expected that values from |
| 28 // CurrentMediaTime() will eventually reflect the new playback rate (e.g., the |
| 29 // media time will advance at half speed if the rate was set to 0.5f). |
| 30 virtual void SetPlaybackRate(float playback_rate) = 0; |
| 31 |
| 32 // Sets the media time to start ticking from. Only valid to call while the |
| 33 // time source is not ticking. |
| 34 virtual void SetMediaTime(base::TimeDelta time) = 0; |
| 35 |
| 36 // Returns the current media time. |
| 37 virtual base::TimeDelta CurrentMediaTime() = 0; |
| 38 }; |
| 39 |
| 40 } // namespace media |
| 41 |
| 42 #endif // MEDIA_BASE_TIME_SOURCE_H_ |
OLD | NEW |