| OLD | NEW |
| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 if (end_of_stream_ && (!selected_range_ || | 473 if (end_of_stream_ && (!selected_range_ || |
| 474 !selected_range_->HasNextBuffer())) { | 474 !selected_range_->HasNextBuffer())) { |
| 475 *out_buffer = StreamParserBuffer::CreateEOSBuffer(); | 475 *out_buffer = StreamParserBuffer::CreateEOSBuffer(); |
| 476 return true; | 476 return true; |
| 477 } | 477 } |
| 478 | 478 |
| 479 return selected_range_ && selected_range_->GetNextBuffer(out_buffer); | 479 return selected_range_ && selected_range_->GetNextBuffer(out_buffer); |
| 480 } | 480 } |
| 481 | 481 |
| 482 std::list<SourceBufferStream::Timespan> | 482 SourceBufferStream::TimespanList SourceBufferStream::GetBufferedTime() const { |
| 483 SourceBufferStream::GetBufferedTime() const { | 483 TimespanList timespans; |
| 484 std::list<Timespan> timespans; | |
| 485 for (RangeList::const_iterator itr = ranges_.begin(); | 484 for (RangeList::const_iterator itr = ranges_.begin(); |
| 486 itr != ranges_.end(); itr++) { | 485 itr != ranges_.end(); itr++) { |
| 487 timespans.push_back((*itr)->GetBufferedTime()); | 486 timespans.push_back((*itr)->GetBufferedTime()); |
| 488 } | 487 } |
| 489 return timespans; | 488 return timespans; |
| 490 } | 489 } |
| 491 | 490 |
| 492 void SourceBufferStream::EndOfStream() { | 491 void SourceBufferStream::EndOfStream() { |
| 493 DCHECK(CanEndOfStream()); | 492 DCHECK(CanEndOfStream()); |
| 494 end_of_stream_ = true; | 493 end_of_stream_ = true; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 DCHECK(!buffers_.empty()); | 736 DCHECK(!buffers_.empty()); |
| 738 return buffers_.front()->GetTimestamp(); | 737 return buffers_.front()->GetTimestamp(); |
| 739 } | 738 } |
| 740 | 739 |
| 741 base::TimeDelta SourceBufferRange::GetEndTimestamp() const { | 740 base::TimeDelta SourceBufferRange::GetEndTimestamp() const { |
| 742 DCHECK(!buffers_.empty()); | 741 DCHECK(!buffers_.empty()); |
| 743 return buffers_.back()->GetEndTimestamp(); | 742 return buffers_.back()->GetEndTimestamp(); |
| 744 } | 743 } |
| 745 | 744 |
| 746 } // namespace media | 745 } // namespace media |
| OLD | NEW |