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

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: fix windows Created 8 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
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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 split_range->waiting_for_keyframe_ = true; 852 split_range->waiting_for_keyframe_ = true;
853 split_range->next_keyframe_timestamp_ = next_keyframe_timestamp_; 853 split_range->next_keyframe_timestamp_ = next_keyframe_timestamp_;
854 ResetNextBufferPosition(); 854 ResetNextBufferPosition();
855 } 855 }
856 856
857 return split_range; 857 return split_range;
858 } 858 }
859 859
860 SourceBufferRange::KeyframeMap::iterator 860 SourceBufferRange::KeyframeMap::iterator
861 SourceBufferRange::GetFirstKeyframeAt(base::TimeDelta timestamp, 861 SourceBufferRange::GetFirstKeyframeAt(base::TimeDelta timestamp,
862 bool skip_given_timestamp) { 862 bool skip_given_timestamp) {
863 KeyframeMap::iterator result = keyframe_map_.lower_bound(timestamp); 863 KeyframeMap::iterator result = keyframe_map_.lower_bound(timestamp);
864 // lower_bound() returns the first element >= |timestamp|, so if we don't want 864 // lower_bound() returns the first element >= |timestamp|, so if we don't want
865 // to include keyframes == |timestamp|, we have to increment the iterator 865 // to include keyframes == |timestamp|, we have to increment the iterator
866 // accordingly. 866 // accordingly.
867 if (skip_given_timestamp && 867 if (skip_given_timestamp &&
868 result != keyframe_map_.end() && result->first == timestamp) { 868 result != keyframe_map_.end() && result->first == timestamp) {
869 ++result; 869 ++result;
870 } 870 }
871 return result; 871 return result;
872 } 872 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 return 2 * GetApproximateDuration(); 1047 return 2 * GetApproximateDuration();
1048 } 1048 }
1049 1049
1050 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 1050 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
1051 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 1051 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
1052 DCHECK(max_interbuffer_distance != kNoTimestamp()); 1052 DCHECK(max_interbuffer_distance != kNoTimestamp());
1053 return max_interbuffer_distance; 1053 return max_interbuffer_distance;
1054 } 1054 }
1055 1055
1056 } // namespace media 1056 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698