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

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

Issue 12224114: Guard against midstream audio configuration changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 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/audio_file_reader_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.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/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // Signal to the stream that duration has changed to |duration|. 211 // Signal to the stream that duration has changed to |duration|.
212 void OnSetDuration(base::TimeDelta duration); 212 void OnSetDuration(base::TimeDelta duration);
213 213
214 // Returns the range of buffered data in this stream, capped at |duration|. 214 // Returns the range of buffered data in this stream, capped at |duration|.
215 Ranges<TimeDelta> GetBufferedRanges(base::TimeDelta duration) const; 215 Ranges<TimeDelta> GetBufferedRanges(base::TimeDelta duration) const;
216 216
217 // Signal to the stream that buffers handed in through subsequent calls to 217 // Signal to the stream that buffers handed in through subsequent calls to
218 // Append() belong to a media segment that starts at |start_timestamp|. 218 // Append() belong to a media segment that starts at |start_timestamp|.
219 void OnNewMediaSegment(TimeDelta start_timestamp); 219 void OnNewMediaSegment(TimeDelta start_timestamp);
220 220
221 // Called when mid-stream config updates occur. 221 // Called when midstream config updates occur.
222 // Returns true if the new config is accepted. 222 // Returns true if the new config is accepted.
223 // Returns false if the new config should trigger an error. 223 // Returns false if the new config should trigger an error.
224 bool UpdateAudioConfig(const AudioDecoderConfig& config); 224 bool UpdateAudioConfig(const AudioDecoderConfig& config);
225 bool UpdateVideoConfig(const VideoDecoderConfig& config); 225 bool UpdateVideoConfig(const VideoDecoderConfig& config);
226 226
227 void EndOfStream(); 227 void EndOfStream();
228 void CancelEndOfStream(); 228 void CancelEndOfStream();
229 bool CanEndOfStream() const; 229 bool CanEndOfStream() const;
230 230
231 void Shutdown(); 231 void Shutdown();
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 1269
1270 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { 1270 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const {
1271 if (audio_ && !video_) 1271 if (audio_ && !video_)
1272 return audio_->GetBufferedRanges(duration_); 1272 return audio_->GetBufferedRanges(duration_);
1273 else if (!audio_ && video_) 1273 else if (!audio_ && video_)
1274 return video_->GetBufferedRanges(duration_); 1274 return video_->GetBufferedRanges(duration_);
1275 return ComputeIntersection(); 1275 return ComputeIntersection();
1276 } 1276 }
1277 1277
1278 } // namespace media 1278 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/audio_file_reader_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698