Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: media/filters/chunk_demuxer.h

Issue 1008463002: Fix MSE GC, make it less aggressive, more spec-compliant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A bit more informative logging + fixed unit test Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Removes buffers between |start| and |end| according to the steps 50 // Removes buffers between |start| and |end| according to the steps
51 // in the "Coded Frame Removal Algorithm" in the Media Source 51 // in the "Coded Frame Removal Algorithm" in the Media Source
52 // Extensions Spec. 52 // Extensions Spec.
53 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sourc e.html#sourcebuffer-coded-frame-removal 53 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sourc e.html#sourcebuffer-coded-frame-removal
54 // 54 //
55 // |duration| is the current duration of the presentation. It is 55 // |duration| is the current duration of the presentation. It is
56 // required by the computation outlined in the spec. 56 // required by the computation outlined in the spec.
57 void Remove(base::TimeDelta start, base::TimeDelta end, 57 void Remove(base::TimeDelta start, base::TimeDelta end,
58 base::TimeDelta duration); 58 base::TimeDelta duration);
59 59
60 // If the buffer is full, attempts to try to free up space, as specified in
61 // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec.
62 // Returns false iff buffer is still full after running eviction.
63 // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction
64 bool EvictCodedFrames(DecodeTimestamp media_time);
65
60 // Signal to the stream that duration has changed to |duration|. 66 // Signal to the stream that duration has changed to |duration|.
61 void OnSetDuration(base::TimeDelta duration); 67 void OnSetDuration(base::TimeDelta duration);
62 68
63 // 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|.
64 Ranges<base::TimeDelta> GetBufferedRanges(base::TimeDelta duration) const; 70 Ranges<base::TimeDelta> GetBufferedRanges(base::TimeDelta duration) const;
65 71
66 // Returns the duration of the buffered data. 72 // Returns the duration of the buffered data.
67 // Returns base::TimeDelta() if the stream has no buffered data. 73 // Returns base::TimeDelta() if the stream has no buffered data.
68 base::TimeDelta GetBufferedDuration() const; 74 base::TimeDelta GetBufferedDuration() const;
69 75
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void Abort(const std::string& id, 243 void Abort(const std::string& id,
238 base::TimeDelta append_window_start, 244 base::TimeDelta append_window_start,
239 base::TimeDelta append_window_end, 245 base::TimeDelta append_window_end,
240 base::TimeDelta* timestamp_offset); 246 base::TimeDelta* timestamp_offset);
241 247
242 // Remove buffers between |start| and |end| for the source buffer 248 // Remove buffers between |start| and |end| for the source buffer
243 // associated with |id|. 249 // associated with |id|.
244 void Remove(const std::string& id, base::TimeDelta start, 250 void Remove(const std::string& id, base::TimeDelta start,
245 base::TimeDelta end); 251 base::TimeDelta end);
246 252
253 bool EvictCodedFrames(base::TimeDelta currentMediaTime);
254
247 // Returns the current presentation duration. 255 // Returns the current presentation duration.
248 double GetDuration(); 256 double GetDuration();
249 double GetDuration_Locked(); 257 double GetDuration_Locked();
250 258
251 // Notifies the demuxer that the duration of the media has changed to 259 // Notifies the demuxer that the duration of the media has changed to
252 // |duration|. 260 // |duration|.
253 void SetDuration(double duration); 261 void SetDuration(double duration);
254 262
255 // Returns true if the source buffer associated with |id| is currently parsing 263 // Returns true if the source buffer associated with |id| is currently parsing
256 // a media segment, or false otherwise. 264 // a media segment, or false otherwise.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 407
400 // Indicates that splice frame generation is enabled. 408 // Indicates that splice frame generation is enabled.
401 const bool splice_frames_enabled_; 409 const bool splice_frames_enabled_;
402 410
403 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 411 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
404 }; 412 };
405 413
406 } // namespace media 414 } // namespace media
407 415
408 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 416 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698