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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // buffered ranges. | 129 // buffered ranges. |
130 Ranges<base::TimeDelta> ComputeIntersection() const; | 130 Ranges<base::TimeDelta> ComputeIntersection() const; |
131 | 131 |
132 // Applies |time_offset| to the timestamps of |buffers|. | 132 // Applies |time_offset| to the timestamps of |buffers|. |
133 void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers, | 133 void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers, |
134 base::TimeDelta timestamp_offset); | 134 base::TimeDelta timestamp_offset); |
135 | 135 |
136 // Returns true if |source_id| is valid, false otherwise. | 136 // Returns true if |source_id| is valid, false otherwise. |
137 bool IsValidId(const std::string& source_id) const; | 137 bool IsValidId(const std::string& source_id) const; |
138 | 138 |
| 139 // Increases |duration_| if the newly appended |buffers| exceeds the current |
| 140 // |duration_|. |
| 141 void IncreaseDurationIfNecessary(const StreamParser::BufferQueue& buffers); |
| 142 |
| 143 // Sets |duration_| to |new_duration| and notifies |host_|. |
| 144 void UpdateDuration(base::TimeDelta new_duration); |
| 145 |
| 146 // Returns the ranges representing the buffered data in the demuxer. |
| 147 Ranges<base::TimeDelta> GetBufferedRanges() const; |
| 148 |
139 mutable base::Lock lock_; | 149 mutable base::Lock lock_; |
140 State state_; | 150 State state_; |
141 | 151 |
142 DemuxerHost* host_; | 152 DemuxerHost* host_; |
143 ChunkDemuxerClient* client_; | 153 ChunkDemuxerClient* client_; |
144 PipelineStatusCB init_cb_; | 154 PipelineStatusCB init_cb_; |
145 PipelineStatusCB seek_cb_; | 155 PipelineStatusCB seek_cb_; |
146 | 156 |
147 scoped_refptr<ChunkDemuxerStream> audio_; | 157 scoped_refptr<ChunkDemuxerStream> audio_; |
148 scoped_refptr<ChunkDemuxerStream> video_; | 158 scoped_refptr<ChunkDemuxerStream> video_; |
(...skipping 18 matching lines...) Expand all Loading... |
167 std::string source_id_video_; | 177 std::string source_id_video_; |
168 | 178 |
169 base::TimeDelta start_time_; | 179 base::TimeDelta start_time_; |
170 | 180 |
171 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 181 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
172 }; | 182 }; |
173 | 183 |
174 } // namespace media | 184 } // namespace media |
175 | 185 |
176 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 186 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |