| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |