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