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> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { | 60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { |
61 public: | 61 public: |
62 // A new potentially encrypted stream has been parsed. | 62 // A new potentially encrypted stream has been parsed. |
63 // First parameter - The type of initialization data. | 63 // First parameter - The type of initialization data. |
64 // Second parameter - The initialization data associated with the stream. | 64 // Second parameter - The initialization data associated with the stream. |
65 using EncryptedMediaInitDataCB = | 65 using EncryptedMediaInitDataCB = |
66 base::Callback<void(EmeInitDataType type, | 66 base::Callback<void(EmeInitDataType type, |
67 const std::vector<uint8_t>& init_data)>; | 67 const std::vector<uint8_t>& init_data)>; |
68 | 68 |
69 // Notifies demuxer clients that media track configuration has been updated | 69 // Notifies demuxer clients that media track configuration has been updated |
70 // (e.g. the inital stream metadata has been parsed successfully, or a new | 70 // (e.g. the initial stream metadata has been parsed successfully, or a new |
71 // init segment has been parsed successfully in MSE case). | 71 // init segment has been parsed successfully in MSE case). |
72 using MediaTracksUpdatedCB = | 72 using MediaTracksUpdatedCB = |
73 base::Callback<void(std::unique_ptr<MediaTracks>)>; | 73 base::Callback<void(std::unique_ptr<MediaTracks>)>; |
74 | 74 |
75 Demuxer(); | 75 Demuxer(); |
76 ~Demuxer() override; | 76 ~Demuxer() override; |
77 | 77 |
78 // Returns the name of the demuxer for logging purpose. | 78 // Returns the name of the demuxer for logging purpose. |
79 virtual std::string GetDisplayName() const = 0; | 79 virtual std::string GetDisplayName() const = 0; |
80 | 80 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 virtual base::TimeDelta GetStartTime() const = 0; | 128 virtual base::TimeDelta GetStartTime() const = 0; |
129 | 129 |
130 // Returns Time represented by presentation timestamp 0. | 130 // Returns Time represented by presentation timestamp 0. |
131 // If the timstamps are not associated with a Time, then | 131 // If the timstamps are not associated with a Time, then |
132 // a null Time is returned. | 132 // a null Time is returned. |
133 virtual base::Time GetTimelineOffset() const = 0; | 133 virtual base::Time GetTimelineOffset() const = 0; |
134 | 134 |
135 // Returns the memory usage in bytes for the demuxer. | 135 // Returns the memory usage in bytes for the demuxer. |
136 virtual int64_t GetMemoryUsage() const = 0; | 136 virtual int64_t GetMemoryUsage() const = 0; |
137 | 137 |
138 // Notifies the demuxer that blink track ids have been assigned to |tracks|. | |
xhwang
2016/06/03 18:52:45
nit: "media" doesn't know about blink. So the |tra
| |
139 // The |track_ids| collection must contain blink track ids in the same | |
140 // sequence as media tracks in |tracks|. The collection sizes must be the | |
141 // same. | |
142 virtual void OnTrackIdsAssigned(const MediaTracks& tracks, | |
143 const std::vector<unsigned>& track_ids) = 0; | |
xhwang
2016/06/03 18:52:45
We don't like to use "unsigned" or "unsigned int"
| |
144 | |
145 // Finds a DemuxerStream corresponding to the given blink |track_id|. Note | |
146 // that the input track id is blink track id and not bytestream track id. | |
147 virtual const DemuxerStream* GetDemuxerStreamByTrackId( | |
148 unsigned track_id) const = 0; | |
149 | |
138 private: | 150 private: |
139 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 151 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
140 }; | 152 }; |
141 | 153 |
142 } // namespace media | 154 } // namespace media |
143 | 155 |
144 #endif // MEDIA_BASE_DEMUXER_H_ | 156 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |