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

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

Issue 10803019: Chrome-side implementation of media source timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT Created 8 years, 4 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_unittest.cc ('k') | media/mp4/mp4_stream_parser.h » ('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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 split_range->waiting_for_keyframe_ = true; 975 split_range->waiting_for_keyframe_ = true;
976 split_range->next_keyframe_timestamp_ = next_keyframe_timestamp_; 976 split_range->next_keyframe_timestamp_ = next_keyframe_timestamp_;
977 ResetNextBufferPosition(); 977 ResetNextBufferPosition();
978 } 978 }
979 979
980 return split_range; 980 return split_range;
981 } 981 }
982 982
983 SourceBufferRange::KeyframeMap::iterator 983 SourceBufferRange::KeyframeMap::iterator
984 SourceBufferRange::GetFirstKeyframeAt(base::TimeDelta timestamp, 984 SourceBufferRange::GetFirstKeyframeAt(base::TimeDelta timestamp,
985 bool skip_given_timestamp) { 985 bool skip_given_timestamp) {
986 KeyframeMap::iterator result = keyframe_map_.lower_bound(timestamp); 986 KeyframeMap::iterator result = keyframe_map_.lower_bound(timestamp);
987 // lower_bound() returns the first element >= |timestamp|, so if we don't want 987 // lower_bound() returns the first element >= |timestamp|, so if we don't want
988 // to include keyframes == |timestamp|, we have to increment the iterator 988 // to include keyframes == |timestamp|, we have to increment the iterator
989 // accordingly. 989 // accordingly.
990 if (skip_given_timestamp && 990 if (skip_given_timestamp &&
991 result != keyframe_map_.end() && result->first == timestamp) { 991 result != keyframe_map_.end() && result->first == timestamp) {
992 ++result; 992 ++result;
993 } 993 }
994 return result; 994 return result;
995 } 995 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 return 2 * GetApproximateDuration(); 1174 return 2 * GetApproximateDuration();
1175 } 1175 }
1176 1176
1177 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 1177 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
1178 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 1178 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
1179 DCHECK(max_interbuffer_distance != kNoTimestamp()); 1179 DCHECK(max_interbuffer_distance != kNoTimestamp());
1180 return max_interbuffer_distance; 1180 return max_interbuffer_distance;
1181 } 1181 }
1182 1182
1183 } // namespace media 1183 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/mp4/mp4_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698