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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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| exceed the current | 139 // Increases |duration_| if the newly appended |buffers| exceed the current |
140 // |duration_|. The |duration_| is set to the end buffered timestamp of | 140 // |duration_|. The |duration_| is set to the end buffered timestamp of |
141 // |stream|. | 141 // |stream|. |
142 void IncreaseDurationIfNecessary( | 142 void IncreaseDurationIfNecessary( |
143 const StreamParser::BufferQueue& buffers, | 143 const StreamParser::BufferQueue& buffers, |
144 const scoped_refptr<ChunkDemuxerStream>& stream); | 144 const scoped_refptr<ChunkDemuxerStream>& stream); |
145 | 145 |
| 146 // Decreases |duration_| if the buffered region is less than |duration_| when |
| 147 // EndOfStream() is called. |
| 148 void DecreaseDurationIfNecessary(); |
| 149 |
146 // Sets |duration_| to |new_duration| and notifies |host_|. | 150 // Sets |duration_| to |new_duration| and notifies |host_|. |
147 void UpdateDuration(base::TimeDelta new_duration); | 151 void UpdateDuration(base::TimeDelta new_duration); |
148 | 152 |
| 153 // Returns the ranges representing the buffered data in the demuxer. |
| 154 Ranges<base::TimeDelta> GetBufferedRanges() const; |
| 155 |
149 mutable base::Lock lock_; | 156 mutable base::Lock lock_; |
150 State state_; | 157 State state_; |
151 | 158 |
152 DemuxerHost* host_; | 159 DemuxerHost* host_; |
153 ChunkDemuxerClient* client_; | 160 ChunkDemuxerClient* client_; |
154 PipelineStatusCB init_cb_; | 161 PipelineStatusCB init_cb_; |
155 PipelineStatusCB seek_cb_; | 162 PipelineStatusCB seek_cb_; |
156 | 163 |
157 scoped_refptr<ChunkDemuxerStream> audio_; | 164 scoped_refptr<ChunkDemuxerStream> audio_; |
158 scoped_refptr<ChunkDemuxerStream> video_; | 165 scoped_refptr<ChunkDemuxerStream> video_; |
(...skipping 18 matching lines...) Expand all Loading... |
177 std::string source_id_video_; | 184 std::string source_id_video_; |
178 | 185 |
179 base::TimeDelta start_time_; | 186 base::TimeDelta start_time_; |
180 | 187 |
181 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 188 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
182 }; | 189 }; |
183 | 190 |
184 } // namespace media | 191 } // namespace media |
185 | 192 |
186 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 193 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |