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/bind.h" | 10 #include "base/bind.h" |
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 } | 1688 } |
1689 | 1689 |
1690 return split_range; | 1690 return split_range; |
1691 } | 1691 } |
1692 | 1692 |
1693 SourceBufferRange::BufferQueue::iterator SourceBufferRange::GetBufferItrAt( | 1693 SourceBufferRange::BufferQueue::iterator SourceBufferRange::GetBufferItrAt( |
1694 base::TimeDelta timestamp, bool skip_given_timestamp) { | 1694 base::TimeDelta timestamp, bool skip_given_timestamp) { |
1695 // Need to make a dummy buffer with timestamp |timestamp| in order to search | 1695 // Need to make a dummy buffer with timestamp |timestamp| in order to search |
1696 // the |buffers_| container. | 1696 // the |buffers_| container. |
1697 scoped_refptr<StreamParserBuffer> dummy_buffer = | 1697 scoped_refptr<StreamParserBuffer> dummy_buffer = |
1698 StreamParserBuffer::CopyFrom(NULL, 0, false); | 1698 StreamParserBuffer::CopyFrom(NULL, 0, false, DemuxerStream::UNKNOWN, 0); |
1699 dummy_buffer->SetDecodeTimestamp(timestamp); | 1699 dummy_buffer->SetDecodeTimestamp(timestamp); |
1700 | 1700 |
1701 if (skip_given_timestamp) { | 1701 if (skip_given_timestamp) { |
1702 return std::upper_bound( | 1702 return std::upper_bound( |
1703 buffers_.begin(), buffers_.end(), dummy_buffer, BufferComparator); | 1703 buffers_.begin(), buffers_.end(), dummy_buffer, BufferComparator); |
1704 } | 1704 } |
1705 return std::lower_bound( | 1705 return std::lower_bound( |
1706 buffers_.begin(), buffers_.end(), dummy_buffer, BufferComparator); | 1706 buffers_.begin(), buffers_.end(), dummy_buffer, BufferComparator); |
1707 } | 1707 } |
1708 | 1708 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2078 return ComputeFudgeRoom(GetApproximateDuration()); | 2078 return ComputeFudgeRoom(GetApproximateDuration()); |
2079 } | 2079 } |
2080 | 2080 |
2081 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { | 2081 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { |
2082 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); | 2082 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); |
2083 DCHECK(max_interbuffer_distance != kNoTimestamp()); | 2083 DCHECK(max_interbuffer_distance != kNoTimestamp()); |
2084 return max_interbuffer_distance; | 2084 return max_interbuffer_distance; |
2085 } | 2085 } |
2086 | 2086 |
2087 } // namespace media | 2087 } // namespace media |
OLD | NEW |