Commit 409aeafc authored by wolenetz's avatar wolenetz Committed by Commit bot

Clean up comments and style of SourceBufferRange header

In preparation for upcoming MSE PTS/DTS compliance fixes, this change
fixes some code style and unclear comments in SourceBufferRange's
header.

BUG=398130

Review-Url: https://codereview.chromium.org/2857983005
Cr-Commit-Position: refs/heads/master@{#469570}
parent 8091ef81
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment