Chromium Code Reviews| Index: media/base/time_source.h |
| diff --git a/media/base/time_source.h b/media/base/time_source.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f9da7735a1f98abcb5450f38805db90f7c71d145 |
| --- /dev/null |
| +++ b/media/base/time_source.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_BASE_TIME_SOURCE_H_ |
| +#define MEDIA_BASE_TIME_SOURCE_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/time/time.h" |
| +#include "media/base/media_export.h" |
| + |
| +namespace media { |
| + |
| +// A TimeSource is capable of providing the current media time. |
| +class MEDIA_EXPORT TimeSource { |
| + public: |
| + // Signal the time source to start ticking. It is expected that values from |
| + // CurrentMediaTimestamp() will start increasing. |
| + virtual void StartTicking() = 0; |
| + |
| + // Signal the time source to start ticking. It is expected that values from |
|
xhwang
2014/07/12 06:36:44
s/start/stop
scherkus (not reviewing)
2014/07/17 23:52:56
Done.
|
| + // CurrentMediaTimestamp() will remain constant. |
| + virtual void StopTicking() = 0; |
| + |
| + // Updates the current playback rate. |
| + virtual void SetPlaybackRate(float playback_rate) = 0; |
|
xhwang
2014/07/12 06:36:44
Can you add comments explaining how current media
scherkus (not reviewing)
2014/07/17 23:52:56
Done.
Let me know if what I wrote is what you had
|
| + |
| + // Sets the media timestamp to start ticking from. Only valid to call while |
| + // the time source is not ticking. |
| + virtual void SetMediaTimestamp(base::TimeDelta timestamp) = 0; |
| + |
| + // Returns the current media timestamp. |
| + virtual base::TimeDelta CurrentMediaTimestamp() = 0; |
|
xhwang
2014/07/12 06:36:44
const function?
Also, can we just have SetMediaTi
scherkus (not reviewing)
2014/07/17 23:52:56
Done for the "time" bit.
I don't think const make
|
| + |
| + protected: |
| + TimeSource() {} |
| + virtual ~TimeSource() {} |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_TIME_SOURCE_H_ |