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

Unified Diff: media/base/clock.h

Issue 9155003: Fix media timeline so that thumb never exceeds buffered data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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/clock.cc » ('j') | media/base/clock.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/clock.h
diff --git a/media/base/clock.h b/media/base/clock.h
index fc1be6dad73c0163680b4602a8adc9f08fede2b0..c6fe636375ea099704e1003316809d3012fe41eb 100644
--- a/media/base/clock.h
+++ b/media/base/clock.h
@@ -48,13 +48,21 @@ class MEDIA_EXPORT Clock {
// will now change.
void SetPlaybackRate(float playback_rate);
- // Forcefully sets the media time to the given time. This should only be used
- // where a discontinuity in the media is found (i.e., seeking).
- void SetTime(const base::TimeDelta& time);
+ // Forcefully sets the media time to |current_time|. The second parameter is
+ // the |max_time| that the clock should progress after a call to Play(). This
+ // value is often the time of the end of the last frame buffered and decoded.
+ void SetTime(base::TimeDelta current_time, base::TimeDelta max_time);
acolwell GONE FROM CHROMIUM 2012/01/13 22:51:21 Comment should mention that the values are clamped
vrk (LEFT CHROMIUM) 2012/01/21 00:54:14 Done.
+
+ void set_max_time(base::TimeDelta max_time) {
+ max_time_ = max_time;
acolwell GONE FROM CHROMIUM 2012/01/13 22:51:21 Implementation should be in .cc & should be clampe
vrk (LEFT CHROMIUM) 2012/01/21 00:54:14 Done.
+ }
// Returns the current elapsed media time.
base::TimeDelta Elapsed() const;
+ void set_media_duration(base::TimeDelta duration) { duration_ = duration; }
acolwell GONE FROM CHROMIUM 2012/01/13 22:51:21 How about dropping media? Impl in .cc & DCHECK(dur
vrk (LEFT CHROMIUM) 2012/01/21 00:54:14 Done.
+ base::TimeDelta media_duration() { return duration_; }
+
private:
// Returns the current media time treating the given time as the latest
// value as returned by |time_provider_|.
@@ -79,6 +87,12 @@ class MEDIA_EXPORT Clock {
// Current playback rate.
float playback_rate_;
+ // The maximum time that can be returned by calls to GetCurrentTime.
+ base::TimeDelta max_time_;
+
+ // Duration of the media.
+ base::TimeDelta duration_;
+
DISALLOW_COPY_AND_ASSIGN(Clock);
};
« no previous file with comments | « no previous file | media/base/clock.cc » ('j') | media/base/clock.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698