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 #include "media/base/ranges.h" |
21 | 21 |
22 namespace media { | 22 namespace media { |
23 | 23 |
24 class TextTrackConfig; | 24 class TextTrackConfig; |
| 25 class MediaTracks; |
25 | 26 |
26 class MEDIA_EXPORT DemuxerHost { | 27 class MEDIA_EXPORT DemuxerHost { |
27 public: | 28 public: |
28 // Notify the host that buffered time ranges have changed. Note that buffered | 29 // Notify the host that buffered time ranges have changed. Note that buffered |
29 // time ranges can grow (when new media data is appended), but they can also | 30 // time ranges can grow (when new media data is appended), but they can also |
30 // shrink (when buffering reaches limit capacity and some buffered data | 31 // 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 // becomes evicted, e.g. due to MSE GC algorithm, or by explicit removal of |
32 // ranges directed by MSE web app). | 33 // ranges directed by MSE web app). |
33 virtual void OnBufferedTimeRangesChanged( | 34 virtual void OnBufferedTimeRangesChanged( |
34 const Ranges<base::TimeDelta>& ranges) = 0; | 35 const Ranges<base::TimeDelta>& ranges) = 0; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual base::TimeDelta GetStartTime() const = 0; | 92 virtual base::TimeDelta GetStartTime() const = 0; |
92 | 93 |
93 // Returns Time represented by presentation timestamp 0. | 94 // Returns Time represented by presentation timestamp 0. |
94 // If the timstamps are not associated with a Time, then | 95 // If the timstamps are not associated with a Time, then |
95 // a null Time is returned. | 96 // a null Time is returned. |
96 virtual base::Time GetTimelineOffset() const = 0; | 97 virtual base::Time GetTimelineOffset() const = 0; |
97 | 98 |
98 // Returns the memory usage in bytes for the demuxer. | 99 // Returns the memory usage in bytes for the demuxer. |
99 virtual int64_t GetMemoryUsage() const = 0; | 100 virtual int64_t GetMemoryUsage() const = 0; |
100 | 101 |
| 102 // Notifies demuxer clients that media track configuration has been updated |
| 103 // (e.g. the inital stream metadata has been parsed successfully, or a new |
| 104 // init segment has been parsed successfully in MSE case). |
| 105 typedef base::Callback<void(scoped_ptr<MediaTracks>)> MediaTracksUpdatedCB; |
| 106 |
101 private: | 107 private: |
102 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 108 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
103 }; | 109 }; |
104 | 110 |
105 } // namespace media | 111 } // namespace media |
106 | 112 |
107 #endif // MEDIA_BASE_DEMUXER_H_ | 113 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |