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

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

Issue 149153002: MSE: Add StreamParser buffer remuxing utility and tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from PS4 Created 6 years, 10 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/chunk_demuxer.cc ('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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/source_buffer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698