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_FILTERS_CHUNK_DEMUXER_H_ | 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 Ranges<base::TimeDelta> GetBufferedRanges(const std::string& id) const; | 67 Ranges<base::TimeDelta> GetBufferedRanges(const std::string& id) const; |
68 | 68 |
69 // Appends media data to the source buffer associated with |id|. Returns | 69 // Appends media data to the source buffer associated with |id|. Returns |
70 // false if this method is called in an invalid state. | 70 // false if this method is called in an invalid state. |
71 bool AppendData(const std::string& id, const uint8* data, size_t length); | 71 bool AppendData(const std::string& id, const uint8* data, size_t length); |
72 | 72 |
73 // Aborts parsing the current segment and reset the parser to a state where | 73 // Aborts parsing the current segment and reset the parser to a state where |
74 // it can accept a new segment. | 74 // it can accept a new segment. |
75 void Abort(const std::string& id); | 75 void Abort(const std::string& id); |
76 | 76 |
| 77 // Notifies the demuxer that the duration of the media has changed to |
| 78 // |duration|. |
| 79 void SetDuration(base::TimeDelta duration); |
| 80 |
77 // Sets a time |offset| to be applied to subsequent buffers appended to the | 81 // Sets a time |offset| to be applied to subsequent buffers appended to the |
78 // source buffer assicated with |id|. Returns true if the offset is set | 82 // source buffer assicated with |id|. Returns true if the offset is set |
79 // properly, false if the offset cannot be applied because we're in the | 83 // properly, false if the offset cannot be applied because we're in the |
80 // middle of parsing a media segment. | 84 // middle of parsing a media segment. |
81 bool SetTimestampOffset(const std::string& id, base::TimeDelta offset); | 85 bool SetTimestampOffset(const std::string& id, base::TimeDelta offset); |
82 | 86 |
83 // Signals an EndOfStream request. | 87 // Signals an EndOfStream request. |
84 // Returns false if called in an unexpected state or if there is a gap between | 88 // Returns false if called in an unexpected state or if there is a gap between |
85 // the current position and the end of the buffered data. | 89 // the current position and the end of the buffered data. |
86 bool EndOfStream(PipelineStatus status); | 90 bool EndOfStream(PipelineStatus status); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // removed with RemoveID() but can not be re-added (yet). | 185 // removed with RemoveID() but can not be re-added (yet). |
182 std::string source_id_audio_; | 186 std::string source_id_audio_; |
183 std::string source_id_video_; | 187 std::string source_id_video_; |
184 | 188 |
185 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 189 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
186 }; | 190 }; |
187 | 191 |
188 } // namespace media | 192 } // namespace media |
189 | 193 |
190 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 194 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |