| 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_BASE_DEMUXER_H_ | 5 #ifndef MEDIA_BASE_DEMUXER_H_ |
| 6 #define MEDIA_BASE_DEMUXER_H_ | 6 #define MEDIA_BASE_DEMUXER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "media/base/data_source.h" | 14 #include "media/base/data_source.h" |
| 15 #include "media/base/demuxer_stream.h" | 15 #include "media/base/demuxer_stream.h" |
| 16 #include "media/base/demuxer_stream_provider.h" | 16 #include "media/base/demuxer_stream_provider.h" |
| 17 #include "media/base/eme_constants.h" | 17 #include "media/base/eme_constants.h" |
| 18 #include "media/base/media_export.h" | 18 #include "media/base/media_export.h" |
| 19 #include "media/base/pipeline_status.h" | 19 #include "media/base/pipeline_status.h" |
| 20 #include "media/base/ranges.h" |
| 20 | 21 |
| 21 namespace media { | 22 namespace media { |
| 22 | 23 |
| 23 class TextTrackConfig; | 24 class TextTrackConfig; |
| 24 | 25 |
| 25 class MEDIA_EXPORT DemuxerHost { | 26 class MEDIA_EXPORT DemuxerHost { |
| 26 public: | 27 public: |
| 27 // Notify the host that time range [start,end] has been buffered. | 28 // Notify the host that buffered time ranges have changed. Note that buffered |
| 28 virtual void AddBufferedTimeRange(base::TimeDelta start, | 29 // time ranges can grow (when new media data is appended), but they can also |
| 29 base::TimeDelta end) = 0; | 30 // shrink (when buffering reaches limit capacity and some buffered data |
| 31 // becomes evicted, e.g. due to MSE GC algorithm, or by explicit removal of |
| 32 // ranges directed by MSE web app). |
| 33 virtual void OnBufferedTimeRangesChanged( |
| 34 const Ranges<base::TimeDelta>& ranges) = 0; |
| 30 | 35 |
| 31 // Sets the duration of the media in microseconds. | 36 // Sets the duration of the media in microseconds. |
| 32 // Duration may be kInfiniteDuration() if the duration is not known. | 37 // Duration may be kInfiniteDuration() if the duration is not known. |
| 33 virtual void SetDuration(base::TimeDelta duration) = 0; | 38 virtual void SetDuration(base::TimeDelta duration) = 0; |
| 34 | 39 |
| 35 // Stops execution of the pipeline due to a fatal error. Do not call this | 40 // Stops execution of the pipeline due to a fatal error. Do not call this |
| 36 // method with PIPELINE_OK. | 41 // method with PIPELINE_OK. |
| 37 virtual void OnDemuxerError(PipelineStatus error) = 0; | 42 virtual void OnDemuxerError(PipelineStatus error) = 0; |
| 38 | 43 |
| 39 // Add |text_stream| to the collection managed by the text renderer. | 44 // Add |text_stream| to the collection managed by the text renderer. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Returns the memory usage in bytes for the demuxer. | 98 // Returns the memory usage in bytes for the demuxer. |
| 94 virtual int64_t GetMemoryUsage() const = 0; | 99 virtual int64_t GetMemoryUsage() const = 0; |
| 95 | 100 |
| 96 private: | 101 private: |
| 97 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 102 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
| 98 }; | 103 }; |
| 99 | 104 |
| 100 } // namespace media | 105 } // namespace media |
| 101 | 106 |
| 102 #endif // MEDIA_BASE_DEMUXER_H_ | 107 #endif // MEDIA_BASE_DEMUXER_H_ |
| OLD | NEW |