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

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

Issue 19649007: Update the WebMediaSourceClientImpl & ChunkDemuxer to received explicit end of stream cancellation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make chromium style enforcers happy Created 7 years, 5 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 | « media/filters/source_buffer_stream.h ('k') | media/filters/source_buffer_stream_unittest.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 #include "media/filters/source_buffer_stream.h" 5 #include "media/filters/source_buffer_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 1054
1055 Ranges<base::TimeDelta> SourceBufferStream::GetBufferedTime() const { 1055 Ranges<base::TimeDelta> SourceBufferStream::GetBufferedTime() const {
1056 Ranges<base::TimeDelta> ranges; 1056 Ranges<base::TimeDelta> ranges;
1057 for (RangeList::const_iterator itr = ranges_.begin(); 1057 for (RangeList::const_iterator itr = ranges_.begin();
1058 itr != ranges_.end(); ++itr) { 1058 itr != ranges_.end(); ++itr) {
1059 ranges.Add((*itr)->GetStartTimestamp(), (*itr)->GetBufferedEndTimestamp()); 1059 ranges.Add((*itr)->GetStartTimestamp(), (*itr)->GetBufferedEndTimestamp());
1060 } 1060 }
1061 return ranges; 1061 return ranges;
1062 } 1062 }
1063 1063
1064 void SourceBufferStream::EndOfStream() { 1064 void SourceBufferStream::MarkEndOfStream() {
1065 DCHECK(!end_of_stream_); 1065 DCHECK(!end_of_stream_);
1066 end_of_stream_ = true; 1066 end_of_stream_ = true;
1067 } 1067 }
1068 1068
1069 void SourceBufferStream::CancelEndOfStream() { 1069 void SourceBufferStream::UnmarkEndOfStream() {
1070 DCHECK(end_of_stream_); 1070 DCHECK(end_of_stream_);
1071 end_of_stream_ = false; 1071 end_of_stream_ = false;
1072 } 1072 }
1073 1073
1074 bool SourceBufferStream::IsEndSelected() const { 1074 bool SourceBufferStream::IsEndSelected() const {
1075 if (ranges_.empty()) 1075 if (ranges_.empty())
1076 return true; 1076 return true;
1077 1077
1078 if (seek_pending_) 1078 if (seek_pending_)
1079 return seek_buffer_timestamp_ >= ranges_.back()->GetBufferedEndTimestamp(); 1079 return seek_buffer_timestamp_ >= ranges_.back()->GetBufferedEndTimestamp();
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 return ComputeFudgeRoom(GetApproximateDuration()); 1769 return ComputeFudgeRoom(GetApproximateDuration());
1770 } 1770 }
1771 1771
1772 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 1772 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
1773 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 1773 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
1774 DCHECK(max_interbuffer_distance != kNoTimestamp()); 1774 DCHECK(max_interbuffer_distance != kNoTimestamp());
1775 return max_interbuffer_distance; 1775 return max_interbuffer_distance;
1776 } 1776 }
1777 1777
1778 } // namespace media 1778 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/source_buffer_stream.h ('k') | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698