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

Unified Diff: media/base/time_source.h

Issue 379343005: Introduce media::TimeSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Timesource 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
« no previous file with comments | « no previous file | media/base/wall_clock_time_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2c5a72028e9fe3b27dc7f7c87f74fb20feafb65c
--- /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/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:
+ TimeSource() {}
+ virtual ~TimeSource() {}
+
+ // Signal the time source to start ticking. It is expected that values from
+ // CurrentMediaTime() will start increasing.
+ virtual void StartTicking() = 0;
+
+ // Signal the time source to stop ticking. It is expected that values from
+ // CurrentMediaTime() will remain constant.
+ virtual void StopTicking() = 0;
+
+ // Updates the current playback rate. It is expected that values from
+ // CurrentMediaTime() will eventually reflect the new playback rate (e.g., the
+ // media time will advance at half speed if the rate was set to 0.5f).
+ virtual void SetPlaybackRate(float playback_rate) = 0;
+
+ // Sets the media time to start ticking from. Only valid to call while the
+ // time source is not ticking.
+ virtual void SetMediaTime(base::TimeDelta time) = 0;
+
+ // Returns the current media time.
+ virtual base::TimeDelta CurrentMediaTime() = 0;
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_TIME_SOURCE_H_
« no previous file with comments | « no previous file | media/base/wall_clock_time_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698