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 @@ ...@@ -16,14 +16,15 @@
namespace media { namespace media {
// Helper class representing a range of buffered data. All buffers in a // Helper class representing a continuous range of buffered data in the
// SourceBufferRange are ordered sequentially in decode timestamp order with no // presentation timeline. All buffers in a SourceBufferRange are ordered
// gaps. // sequentially in decode timestamp order with no gaps.
class SourceBufferRange { class SourceBufferRange {
public: public:
// Returns the maximum distance in time between any buffer seen in this // Returns the maximum distance in time between any buffer seen in the stream
// stream. Used to estimate the duration of a buffer if its duration is not // of which this range is a part. Used to estimate the duration of a buffer if
// known. // 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 base::Callback<base::TimeDelta()> InterbufferDistanceCB;
typedef StreamParser::BufferQueue BufferQueue; typedef StreamParser::BufferQueue BufferQueue;
...@@ -37,22 +38,13 @@ class SourceBufferRange { ...@@ -37,22 +38,13 @@ class SourceBufferRange {
ALLOW_GAPS 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 // Sequential buffers with the same decode timestamp make sense under certain
// conditions, typically when the first buffer is a keyframe. Due to some // conditions, typically when the first buffer is a keyframe. Due to some
// atypical media append behaviors where a new keyframe might have the same // atypical media append behaviors where a new keyframe might have the same
// timestamp as a previous non-keyframe, the playback of the sequence might // decode timestamp as a previous non-keyframe, the playback of the sequence
// involve some throwaway decode work. This method supports detecting this // might involve some throwaway decode work. This method supports detecting
// situation so that callers can log warnings (it returns true in this case // this situation so that callers can log warnings (it returns true in this
// only). // case only).
// For all other cases, including more typical same-DTS sequences, this method // For all other cases, including more typical same-DTS sequences, this method
// returns false. Examples of typical situations where DTS of two consecutive // returns false. Examples of typical situations where DTS of two consecutive
// frames can be equal: // frames can be equal:
...@@ -107,6 +99,15 @@ class SourceBufferRange { ...@@ -107,6 +99,15 @@ class SourceBufferRange {
// Assumes |timestamp| is valid and in this range. // Assumes |timestamp| is valid and in this range.
void Seek(DecodeTimestamp timestamp); 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 // Updates |next_buffer_index_| to point to next keyframe after or equal to
// |timestamp|. // |timestamp|.
void SeekAheadTo(DecodeTimestamp 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