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

Unified Diff: media/filters/source_buffer_range.h

Issue 2857983005: Clean up comments and style of SourceBufferRange header (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_range.h
diff --git a/media/filters/source_buffer_range.h b/media/filters/source_buffer_range.h
index 3a9fcc36f3af90d0aeede1b4713db4c0c396257e..be2f1effe84933c4378e4086aad9baf1c1636be2 100644
--- a/media/filters/source_buffer_range.h
+++ b/media/filters/source_buffer_range.h
@@ -16,14 +16,15 @@
namespace media {
-// Helper class representing a range of buffered data. All buffers in a
-// SourceBufferRange are ordered sequentially in decode timestamp order with no
-// gaps.
+// Helper class representing a continuous range of buffered data in the
+// presentation timeline. All buffers in a SourceBufferRange are ordered
+// sequentially in decode timestamp order with no gaps.
class SourceBufferRange {
public:
- // Returns the maximum distance in time between any buffer seen in this
- // stream. Used to estimate the duration of a buffer if its duration is not
- // known.
+ // Returns the maximum distance in time between any buffer seen in the stream
+ // of which this range is a part. Used to estimate the duration of a buffer if
+ // its duration is not known, and in GetFudgeRoom() for determining whether a
+ // time or coded frame is close enough to be considered part of this range.
typedef base::Callback<base::TimeDelta()> InterbufferDistanceCB;
typedef StreamParser::BufferQueue BufferQueue;
@@ -37,22 +38,13 @@ class SourceBufferRange {
ALLOW_GAPS
};
- // Return the config ID for the buffer at |timestamp|. Precondition: callers
- // must first verify CanSeekTo(timestamp) == true.
- int GetConfigIdAtTime(DecodeTimestamp timestamp);
-
- // Return true if all buffers in range of [start, end] have the same config
- // ID. Precondition: callers must first verify that
- // CanSeekTo(start) == CanSeekTo(end) == true.
- bool SameConfigThruRange(DecodeTimestamp start, DecodeTimestamp end);
-
// Sequential buffers with the same decode timestamp make sense under certain
// conditions, typically when the first buffer is a keyframe. Due to some
// atypical media append behaviors where a new keyframe might have the same
- // timestamp as a previous non-keyframe, the playback of the sequence might
- // involve some throwaway decode work. This method supports detecting this
- // situation so that callers can log warnings (it returns true in this case
- // only).
+ // decode timestamp as a previous non-keyframe, the playback of the sequence
+ // might involve some throwaway decode work. This method supports detecting
+ // this situation so that callers can log warnings (it returns true in this
+ // case only).
// For all other cases, including more typical same-DTS sequences, this method
// returns false. Examples of typical situations where DTS of two consecutive
// frames can be equal:
@@ -107,6 +99,15 @@ class SourceBufferRange {
// Assumes |timestamp| is valid and in this range.
void Seek(DecodeTimestamp timestamp);
+ // Return the config ID for the buffer at |timestamp|. Precondition: callers
+ // must first verify CanSeekTo(timestamp) == true.
+ int GetConfigIdAtTime(DecodeTimestamp timestamp);
+
+ // Return true if all buffers in range of [start, end] have the same config
+ // ID. Precondition: callers must first verify that
+ // CanSeekTo(start) == CanSeekTo(end) == true.
+ bool SameConfigThruRange(DecodeTimestamp start, DecodeTimestamp end);
+
// Updates |next_buffer_index_| to point to next keyframe after or equal to
// |timestamp|.
void SeekAheadTo(DecodeTimestamp timestamp);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698