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 <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "media/base/data_source.h" | 15 #include "media/base/data_source.h" |
16 #include "media/base/demuxer_stream.h" | 16 #include "media/base/demuxer_stream.h" |
17 #include "media/base/demuxer_stream_provider.h" | 17 #include "media/base/demuxer_stream_provider.h" |
18 #include "media/base/eme_constants.h" | 18 #include "media/base/eme_constants.h" |
19 #include "media/base/media_export.h" | 19 #include "media/base/media_export.h" |
| 20 #include "media/base/media_track.h" |
20 #include "media/base/pipeline_status.h" | 21 #include "media/base/pipeline_status.h" |
21 #include "media/base/ranges.h" | 22 #include "media/base/ranges.h" |
22 | 23 |
23 namespace media { | 24 namespace media { |
24 | 25 |
25 class TextTrackConfig; | 26 class TextTrackConfig; |
26 class MediaTracks; | 27 class MediaTracks; |
27 | 28 |
28 class MEDIA_EXPORT DemuxerHost { | 29 class MEDIA_EXPORT DemuxerHost { |
29 public: | 30 public: |
(...skipping 30 matching lines...) Expand all Loading... |
60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { | 61 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { |
61 public: | 62 public: |
62 // A new potentially encrypted stream has been parsed. | 63 // A new potentially encrypted stream has been parsed. |
63 // First parameter - The type of initialization data. | 64 // First parameter - The type of initialization data. |
64 // Second parameter - The initialization data associated with the stream. | 65 // Second parameter - The initialization data associated with the stream. |
65 using EncryptedMediaInitDataCB = | 66 using EncryptedMediaInitDataCB = |
66 base::Callback<void(EmeInitDataType type, | 67 base::Callback<void(EmeInitDataType type, |
67 const std::vector<uint8_t>& init_data)>; | 68 const std::vector<uint8_t>& init_data)>; |
68 | 69 |
69 // Notifies demuxer clients that media track configuration has been updated | 70 // Notifies demuxer clients that media track configuration has been updated |
70 // (e.g. the inital stream metadata has been parsed successfully, or a new | 71 // (e.g. the initial stream metadata has been parsed successfully, or a new |
71 // init segment has been parsed successfully in MSE case). | 72 // init segment has been parsed successfully in MSE case). |
72 using MediaTracksUpdatedCB = | 73 using MediaTracksUpdatedCB = |
73 base::Callback<void(std::unique_ptr<MediaTracks>)>; | 74 base::Callback<void(std::unique_ptr<MediaTracks>)>; |
74 | 75 |
75 Demuxer(); | 76 Demuxer(); |
76 ~Demuxer() override; | 77 ~Demuxer() override; |
77 | 78 |
78 // Returns the name of the demuxer for logging purpose. | 79 // Returns the name of the demuxer for logging purpose. |
79 virtual std::string GetDisplayName() const = 0; | 80 virtual std::string GetDisplayName() const = 0; |
80 | 81 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 virtual base::TimeDelta GetStartTime() const = 0; | 129 virtual base::TimeDelta GetStartTime() const = 0; |
129 | 130 |
130 // Returns Time represented by presentation timestamp 0. | 131 // Returns Time represented by presentation timestamp 0. |
131 // If the timstamps are not associated with a Time, then | 132 // If the timstamps are not associated with a Time, then |
132 // a null Time is returned. | 133 // a null Time is returned. |
133 virtual base::Time GetTimelineOffset() const = 0; | 134 virtual base::Time GetTimelineOffset() const = 0; |
134 | 135 |
135 // Returns the memory usage in bytes for the demuxer. | 136 // Returns the memory usage in bytes for the demuxer. |
136 virtual int64_t GetMemoryUsage() const = 0; | 137 virtual int64_t GetMemoryUsage() const = 0; |
137 | 138 |
| 139 virtual void OnEnabledAudioTracksChanged( |
| 140 const std::vector<MediaTrack::Id>& track_ids, |
| 141 base::TimeDelta currTime) = 0; |
| 142 // |track_ids| is either empty or contains a single video track id. |
| 143 virtual void OnSelectedVideoTrackChanged( |
| 144 const std::vector<MediaTrack::Id>& track_ids, |
| 145 base::TimeDelta currTime) = 0; |
| 146 |
138 private: | 147 private: |
139 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 148 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
140 }; | 149 }; |
141 | 150 |
142 } // namespace media | 151 } // namespace media |
143 | 152 |
144 #endif // MEDIA_BASE_DEMUXER_H_ | 153 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |