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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/wall_clock_time_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« 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