Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: media/base/time_source.h

Issue 379343005: Introduce media::TimeSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698