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 <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Removes buffers between |start| and |end| according to the steps | 49 // Removes buffers between |start| and |end| according to the steps |
50 // in the "Coded Frame Removal Algorithm" in the Media Source | 50 // in the "Coded Frame Removal Algorithm" in the Media Source |
51 // Extensions Spec. | 51 // Extensions Spec. |
52 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sourc
e.html#sourcebuffer-coded-frame-removal | 52 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sourc
e.html#sourcebuffer-coded-frame-removal |
53 // | 53 // |
54 // |duration| is the current duration of the presentation. It is | 54 // |duration| is the current duration of the presentation. It is |
55 // required by the computation outlined in the spec. | 55 // required by the computation outlined in the spec. |
56 void Remove(base::TimeDelta start, base::TimeDelta end, | 56 void Remove(base::TimeDelta start, base::TimeDelta end, |
57 base::TimeDelta duration); | 57 base::TimeDelta duration); |
58 | 58 |
| 59 // If the buffer is full, runs Frame Removal to try to free up space, as |
| 60 // specified in the "Coded Frame Eviction Algorithm" in the Media Source |
| 61 // Extensions Spec. Returns false iff buffer is still full after running |
| 62 // eviction |
| 63 // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
| 64 bool EvictFrames(); |
| 65 |
59 // Signal to the stream that duration has changed to |duration|. | 66 // Signal to the stream that duration has changed to |duration|. |
60 void OnSetDuration(base::TimeDelta duration); | 67 void OnSetDuration(base::TimeDelta duration); |
61 | 68 |
62 // Returns the range of buffered data in this stream, capped at |duration|. | 69 // Returns the range of buffered data in this stream, capped at |duration|. |
63 Ranges<base::TimeDelta> GetBufferedRanges(base::TimeDelta duration) const; | 70 Ranges<base::TimeDelta> GetBufferedRanges(base::TimeDelta duration) const; |
64 | 71 |
65 // Returns the duration of the buffered data. | 72 // Returns the duration of the buffered data. |
66 // Returns base::TimeDelta() if the stream has no buffered data. | 73 // Returns base::TimeDelta() if the stream has no buffered data. |
67 base::TimeDelta GetBufferedDuration() const; | 74 base::TimeDelta GetBufferedDuration() const; |
68 | 75 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 void Abort(const std::string& id, | 242 void Abort(const std::string& id, |
236 base::TimeDelta append_window_start, | 243 base::TimeDelta append_window_start, |
237 base::TimeDelta append_window_end, | 244 base::TimeDelta append_window_end, |
238 base::TimeDelta* timestamp_offset); | 245 base::TimeDelta* timestamp_offset); |
239 | 246 |
240 // Remove buffers between |start| and |end| for the source buffer | 247 // Remove buffers between |start| and |end| for the source buffer |
241 // associated with |id|. | 248 // associated with |id|. |
242 void Remove(const std::string& id, base::TimeDelta start, | 249 void Remove(const std::string& id, base::TimeDelta start, |
243 base::TimeDelta end); | 250 base::TimeDelta end); |
244 | 251 |
| 252 bool EvictFrames(); |
| 253 |
245 // Returns the current presentation duration. | 254 // Returns the current presentation duration. |
246 double GetDuration(); | 255 double GetDuration(); |
247 double GetDuration_Locked(); | 256 double GetDuration_Locked(); |
248 | 257 |
249 // Notifies the demuxer that the duration of the media has changed to | 258 // Notifies the demuxer that the duration of the media has changed to |
250 // |duration|. | 259 // |duration|. |
251 void SetDuration(double duration); | 260 void SetDuration(double duration); |
252 | 261 |
253 // Returns true if the source buffer associated with |id| is currently parsing | 262 // Returns true if the source buffer associated with |id| is currently parsing |
254 // a media segment, or false otherwise. | 263 // a media segment, or false otherwise. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 408 |
400 // Indicates that splice frame generation is enabled. | 409 // Indicates that splice frame generation is enabled. |
401 const bool splice_frames_enabled_; | 410 const bool splice_frames_enabled_; |
402 | 411 |
403 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 412 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
404 }; | 413 }; |
405 | 414 |
406 } // namespace media | 415 } // namespace media |
407 | 416 |
408 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 417 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |