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

Side by Side Diff: media/base/clock.h

Issue 294133003: Extract media::Clock::IsPlaying() into media::Pipeline::ClockState enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes + rebase Created 6 years, 7 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/clock.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_CLOCK_H_ 5 #ifndef MEDIA_BASE_CLOCK_H_
6 #define MEDIA_BASE_CLOCK_H_ 6 #define MEDIA_BASE_CLOCK_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void SetMaxTime(base::TimeDelta max_time); 63 void SetMaxTime(base::TimeDelta max_time);
64 64
65 // Returns the current elapsed media time. Returns 0 if SetDuration() has 65 // Returns the current elapsed media time. Returns 0 if SetDuration() has
66 // never been called. 66 // never been called.
67 base::TimeDelta Elapsed(); 67 base::TimeDelta Elapsed();
68 68
69 // Sets the duration of the video. Clock expects the duration will be set 69 // Sets the duration of the video. Clock expects the duration will be set
70 // exactly once. 70 // exactly once.
71 void SetDuration(base::TimeDelta duration); 71 void SetDuration(base::TimeDelta duration);
72 72
73 // Resets clock to an uninitialized state.
74 void Reset();
75
76 // Notifies the clock that the end of stream has been reached. The clock state
77 // is updated accordingly.
78 void EndOfStream();
79
80 // Returns the duration of the clock, or 0 if not set. 73 // Returns the duration of the clock, or 0 if not set.
81 base::TimeDelta Duration() const; 74 base::TimeDelta Duration() const;
82 75
83 private: 76 private:
84 // Updates the reference points based on the current calculated time. 77 // Updates the reference points based on the current calculated time.
85 void UpdateReferencePoints(); 78 void UpdateReferencePoints();
86 79
87 // Updates the reference points based on the given |current_time|. 80 // Updates the reference points based on the given |current_time|.
88 void UpdateReferencePoints(base::TimeDelta current_time); 81 void UpdateReferencePoints(base::TimeDelta current_time);
89 82
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 115
123 // Duration of the media. 116 // Duration of the media.
124 base::TimeDelta duration_; 117 base::TimeDelta duration_;
125 118
126 DISALLOW_COPY_AND_ASSIGN(Clock); 119 DISALLOW_COPY_AND_ASSIGN(Clock);
127 }; 120 };
128 121
129 } // namespace media 122 } // namespace media
130 123
131 #endif // MEDIA_BASE_CLOCK_H_ 124 #endif // MEDIA_BASE_CLOCK_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/clock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698