| 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 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); | 282 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); |
| 283 | 283 |
| 284 void OnNewTextTrack(ChunkDemuxerStream* text_stream, | 284 void OnNewTextTrack(ChunkDemuxerStream* text_stream, |
| 285 const TextTrackConfig& config); | 285 const TextTrackConfig& config); |
| 286 void OnNewMediaSegment(const std::string& source_id, | 286 void OnNewMediaSegment(const std::string& source_id, |
| 287 base::TimeDelta start_timestamp); | 287 base::TimeDelta start_timestamp); |
| 288 | 288 |
| 289 // Returns true if |source_id| is valid, false otherwise. | 289 // Returns true if |source_id| is valid, false otherwise. |
| 290 bool IsValidId(const std::string& source_id) const; | 290 bool IsValidId(const std::string& source_id) const; |
| 291 | 291 |
| 292 // Increases |duration_| if |last_appended_buffer_timestamp| exceeds the | 292 // Increases |duration_| to |new_duration|, if |new_duration| is higher. |
| 293 // current |duration_|. The |duration_| is set to the end buffered timestamp | 293 void IncreaseDurationIfNecessary(base::TimeDelta new_duration); |
| 294 // of |stream|. | |
| 295 void IncreaseDurationIfNecessary( | |
| 296 base::TimeDelta last_appended_buffer_timestamp, | |
| 297 ChunkDemuxerStream* stream); | |
| 298 | 294 |
| 299 // Decreases |duration_| if the buffered region is less than |duration_| when | 295 // Decreases |duration_| if the buffered region is less than |duration_| when |
| 300 // EndOfStream() is called. | 296 // EndOfStream() is called. |
| 301 void DecreaseDurationIfNecessary(); | 297 void DecreaseDurationIfNecessary(); |
| 302 | 298 |
| 303 // Sets |duration_| to |new_duration|, sets |user_specified_duration_| to -1 | 299 // Sets |duration_| to |new_duration|, sets |user_specified_duration_| to -1 |
| 304 // and notifies |host_|. | 300 // and notifies |host_|. |
| 305 void UpdateDuration(base::TimeDelta new_duration); | 301 void UpdateDuration(base::TimeDelta new_duration); |
| 306 | 302 |
| 307 // Returns the ranges representing the buffered data in the demuxer. | 303 // Returns the ranges representing the buffered data in the demuxer. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // removed with RemoveID() but can not be re-added (yet). | 361 // removed with RemoveID() but can not be re-added (yet). |
| 366 std::string source_id_audio_; | 362 std::string source_id_audio_; |
| 367 std::string source_id_video_; | 363 std::string source_id_video_; |
| 368 | 364 |
| 369 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 365 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
| 370 }; | 366 }; |
| 371 | 367 |
| 372 } // namespace media | 368 } // namespace media |
| 373 | 369 |
| 374 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 370 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| OLD | NEW |