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

Side by Side Diff: media/filters/source_buffer_stream.h

Issue 1119163005: Return EOS when selected_range_ is NULL in SourceBufferStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nipicks Created 5 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
« no previous file with comments | « no previous file | media/filters/source_buffer_stream.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 // SourceBufferStream is a data structure that stores media Buffers in ranges. 5 // SourceBufferStream is a data structure that stores media Buffers in ranges.
6 // Buffers can be appended out of presentation order. Buffers are retrieved by 6 // Buffers can be appended out of presentation order. Buffers are retrieved by
7 // seeking to the desired start point and calling GetNextBuffer(). Buffers are 7 // seeking to the desired start point and calling GetNextBuffer(). Buffers are
8 // returned in sequential presentation order. 8 // returned in sequential presentation order.
9 9
10 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ 10 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 // Searches |ranges_| for the first keyframe timestamp that is >= |timestamp|. 269 // Searches |ranges_| for the first keyframe timestamp that is >= |timestamp|.
270 // If |ranges_| doesn't contain a GOP that covers |timestamp| or doesn't 270 // If |ranges_| doesn't contain a GOP that covers |timestamp| or doesn't
271 // have a keyframe after |timestamp| then kNoTimestamp() is returned. 271 // have a keyframe after |timestamp| then kNoTimestamp() is returned.
272 DecodeTimestamp FindKeyframeAfterTimestamp(const DecodeTimestamp timestamp); 272 DecodeTimestamp FindKeyframeAfterTimestamp(const DecodeTimestamp timestamp);
273 273
274 // Returns "VIDEO" for a video SourceBufferStream, "AUDIO" for an audio 274 // Returns "VIDEO" for a video SourceBufferStream, "AUDIO" for an audio
275 // stream, and "TEXT" for a text stream. 275 // stream, and "TEXT" for a text stream.
276 std::string GetStreamTypeName() const; 276 std::string GetStreamTypeName() const;
277 277
278 // Returns true if we don't have any ranges or the last range is selected 278 // Returns true if end of stream has been reached, i.e. the
279 // or there is a pending seek beyond any existing ranges. 279 // following conditions are met:
280 bool IsEndSelected() const; 280 // 1. end of stream is marked and there is nothing in the track_buffer.
281 // 2. We don't have any ranges, or the last or no range is selected,
282 // or there is a pending seek beyond any existing ranges.
283 bool IsEndOfStreamReached() const;
281 284
282 // Deletes the range pointed to by |*itr| and removes it from |ranges_|. 285 // Deletes the range pointed to by |*itr| and removes it from |ranges_|.
283 // If |*itr| points to |selected_range_|, then |selected_range_| is set to 286 // If |*itr| points to |selected_range_|, then |selected_range_| is set to
284 // NULL. After the range is removed, |*itr| is to the range after the one that 287 // NULL. After the range is removed, |*itr| is to the range after the one that
285 // was removed or to |ranges_.end()| if the last range was removed. 288 // was removed or to |ranges_.end()| if the last range was removed.
286 void DeleteAndRemoveRange(RangeList::iterator* itr); 289 void DeleteAndRemoveRange(RangeList::iterator* itr);
287 290
288 // Helper function used by Remove() and PrepareRangesForNextAppend() to 291 // Helper function used by Remove() and PrepareRangesForNextAppend() to
289 // remove buffers and ranges between |start| and |end|. 292 // remove buffers and ranges between |start| and |end|.
290 // |exclude_start| - If set to true, buffers with timestamps that 293 // |exclude_start| - If set to true, buffers with timestamps that
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 418
416 // Indicates that splice frame generation is enabled. 419 // Indicates that splice frame generation is enabled.
417 const bool splice_frames_enabled_; 420 const bool splice_frames_enabled_;
418 421
419 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); 422 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream);
420 }; 423 };
421 424
422 } // namespace media 425 } // namespace media
423 426
424 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ 427 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698