Chromium Code Reviews| 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 MediaTrack; | |
| 25 class MediaTracks; | 26 class MediaTracks; |
| 26 | 27 |
| 27 class MEDIA_EXPORT DemuxerHost { | 28 class MEDIA_EXPORT DemuxerHost { |
| 28 public: | 29 public: |
| 29 // Notify the host that buffered time ranges have changed. Note that buffered | 30 // Notify the host that buffered time ranges have changed. Note that buffered |
| 30 // time ranges can grow (when new media data is appended), but they can also | 31 // time ranges can grow (when new media data is appended), but they can also |
| 31 // shrink (when buffering reaches limit capacity and some buffered data | 32 // shrink (when buffering reaches limit capacity and some buffered data |
| 32 // becomes evicted, e.g. due to MSE GC algorithm, or by explicit removal of | 33 // becomes evicted, e.g. due to MSE GC algorithm, or by explicit removal of |
| 33 // ranges directed by MSE web app). | 34 // ranges directed by MSE web app). |
| 34 virtual void OnBufferedTimeRangesChanged( | 35 virtual void OnBufferedTimeRangesChanged( |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 59 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { | 60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { |
| 60 public: | 61 public: |
| 61 // A new potentially encrypted stream has been parsed. | 62 // A new potentially encrypted stream has been parsed. |
| 62 // First parameter - The type of initialization data. | 63 // First parameter - The type of initialization data. |
| 63 // Second parameter - The initialization data associated with the stream. | 64 // Second parameter - The initialization data associated with the stream. |
| 64 typedef base::Callback<void(EmeInitDataType type, | 65 typedef base::Callback<void(EmeInitDataType type, |
| 65 const std::vector<uint8_t>& init_data)> | 66 const std::vector<uint8_t>& init_data)> |
| 66 EncryptedMediaInitDataCB; | 67 EncryptedMediaInitDataCB; |
| 67 | 68 |
| 68 // Notifies demuxer clients that media track configuration has been updated | 69 // Notifies demuxer clients that media track configuration has been updated |
| 69 // (e.g. the inital stream metadata has been parsed successfully, or a new | 70 // (e.g. the inital stream metadata has been parsed successfully, or a new |
|
wolenetz
2016/03/30 00:31:32
nit aside: s/inital/initial/
servolk
2016/03/30 01:13:12
Done.
| |
| 70 // init segment has been parsed successfully in MSE case). | 71 // init segment has been parsed successfully in MSE case). |
| 71 typedef base::Callback<void(scoped_ptr<MediaTracks>)> MediaTracksUpdatedCB; | 72 typedef base::Callback<void(scoped_ptr<MediaTracks>)> MediaTracksUpdatedCB; |
| 72 | 73 |
| 73 Demuxer(); | 74 Demuxer(); |
| 74 ~Demuxer() override; | 75 ~Demuxer() override; |
| 75 | 76 |
| 76 // Returns the name of the demuxer for logging purpose. | 77 // Returns the name of the demuxer for logging purpose. |
| 77 virtual std::string GetDisplayName() const = 0; | 78 virtual std::string GetDisplayName() const = 0; |
| 78 | 79 |
| 79 // Completes initialization of the demuxer. | 80 // Completes initialization of the demuxer. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 virtual base::TimeDelta GetStartTime() const = 0; | 127 virtual base::TimeDelta GetStartTime() const = 0; |
| 127 | 128 |
| 128 // Returns Time represented by presentation timestamp 0. | 129 // Returns Time represented by presentation timestamp 0. |
| 129 // If the timstamps are not associated with a Time, then | 130 // If the timstamps are not associated with a Time, then |
| 130 // a null Time is returned. | 131 // a null Time is returned. |
| 131 virtual base::Time GetTimelineOffset() const = 0; | 132 virtual base::Time GetTimelineOffset() const = 0; |
| 132 | 133 |
| 133 // Returns the memory usage in bytes for the demuxer. | 134 // Returns the memory usage in bytes for the demuxer. |
| 134 virtual int64_t GetMemoryUsage() const = 0; | 135 virtual int64_t GetMemoryUsage() const = 0; |
| 135 | 136 |
| 137 // Notifies the demuxer that a track id has been assigned to a media track. | |
|
wolenetz
2016/03/30 00:31:32
nit: is this a blink track id? Clarify in comment
| |
| 138 // If |track| is null the association for this |track_id| is removed. | |
| 139 virtual void OnTrackIdAssigned(unsigned track_id, | |
|
wolenetz
2016/03/30 00:31:32
Question: would these be better in DemuxerHost?
servolk
2016/03/30 01:13:12
Why in DemuxerHost? I was thinking about moving th
| |
| 140 const MediaTrack* track) = 0; | |
| 141 | |
| 142 // Finds a DemuxerStream corresponding to the given blink |track_id|. Note | |
| 143 // that the input track id is blink track id and not bytestream track id. | |
| 144 virtual const DemuxerStream* GetDemuxerStreamByTrackId( | |
| 145 unsigned track_id) const = 0; | |
| 146 | |
| 136 private: | 147 private: |
| 137 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 148 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
| 138 }; | 149 }; |
| 139 | 150 |
| 140 } // namespace media | 151 } // namespace media |
| 141 | 152 |
| 142 #endif // MEDIA_BASE_DEMUXER_H_ | 153 #endif // MEDIA_BASE_DEMUXER_H_ |
| OLD | NEW |