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

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

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarity. 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
« media/base/audio_splicer.cc ('K') | « media/base/decoder_buffer.cc ('k') | no next file » | 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 if (fade_out_preroll_index_ < fade_out_preroll.size()) { 1125 if (fade_out_preroll_index_ < fade_out_preroll.size()) {
1126 // Account for config changes which occur between fade out buffers. 1126 // Account for config changes which occur between fade out buffers.
1127 if (current_config_index_ != 1127 if (current_config_index_ !=
1128 fade_out_preroll[fade_out_preroll_index_]->GetConfigId()) { 1128 fade_out_preroll[fade_out_preroll_index_]->GetConfigId()) {
1129 config_change_pending_ = true; 1129 config_change_pending_ = true;
1130 DVLOG(1) << "Config change (fade out preroll config ID does not match)."; 1130 DVLOG(1) << "Config change (fade out preroll config ID does not match).";
1131 return SourceBufferStream::kConfigChange; 1131 return SourceBufferStream::kConfigChange;
1132 } 1132 }
1133 1133
1134 *out_buffer = fade_out_preroll[fade_out_preroll_index_++]; 1134 *out_buffer = fade_out_preroll[fade_out_preroll_index_++];
1135 (*out_buffer)->set_splice_preroll(true);
1135 return SourceBufferStream::kSuccess; 1136 return SourceBufferStream::kSuccess;
1136 } 1137 }
1137 1138
1138 // Did we hand out the last fade out buffer on the last call? 1139 // Did we hand out the last fade out buffer on the last call?
1139 if (fade_out_preroll_index_ == fade_out_preroll.size()) { 1140 if (fade_out_preroll_index_ == fade_out_preroll.size()) {
1140 fade_out_preroll_index_++; 1141 fade_out_preroll_index_++;
1141 config_change_pending_ = true; 1142 config_change_pending_ = true;
1142 DVLOG(1) << "Config change (forced for fade in of splice frame)."; 1143 DVLOG(1) << "Config change (forced for fade in of splice frame).";
1143 return SourceBufferStream::kConfigChange; 1144 return SourceBufferStream::kConfigChange;
1144 } 1145 }
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 return ComputeFudgeRoom(GetApproximateDuration()); 2079 return ComputeFudgeRoom(GetApproximateDuration());
2079 } 2080 }
2080 2081
2081 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 2082 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
2082 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 2083 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
2083 DCHECK(max_interbuffer_distance != kNoTimestamp()); 2084 DCHECK(max_interbuffer_distance != kNoTimestamp());
2084 return max_interbuffer_distance; 2085 return max_interbuffer_distance;
2085 } 2086 }
2086 2087
2087 } // namespace media 2088 } // namespace media
OLDNEW
« media/base/audio_splicer.cc ('K') | « media/base/decoder_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698