OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_SOURCE_BUFFER_STATE_H_ | 5 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ |
6 #define MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ | 6 #define MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 TimeDelta* timestamp_offset); | 67 TimeDelta* timestamp_offset); |
68 | 68 |
69 // Calls Remove(|start|, |end|, |duration|) on all | 69 // Calls Remove(|start|, |end|, |duration|) on all |
70 // ChunkDemuxerStreams managed by this object. | 70 // ChunkDemuxerStreams managed by this object. |
71 void Remove(TimeDelta start, TimeDelta end, TimeDelta duration); | 71 void Remove(TimeDelta start, TimeDelta end, TimeDelta duration); |
72 | 72 |
73 // If the buffer is full, attempts to try to free up space, as specified in | 73 // If the buffer is full, attempts to try to free up space, as specified in |
74 // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec. | 74 // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec. |
75 // Returns false iff buffer is still full after running eviction. | 75 // Returns false iff buffer is still full after running eviction. |
76 // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction | 76 // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
77 bool EvictCodedFrames(DecodeTimestamp media_time, size_t newDataSize); | 77 bool EvictCodedFrames(base::TimeDelta media_time, size_t newDataSize); |
78 | 78 |
79 // Gets invoked when the system is experiencing memory pressure, i.e. there's | 79 // Gets invoked when the system is experiencing memory pressure, i.e. there's |
80 // not enough free memory. The |media_time| is the media playback position at | 80 // not enough free memory. The |media_time| is the media playback position at |
81 // the time of memory pressure notification (needed for accurate GC). The | 81 // the time of memory pressure notification (needed for accurate GC). The |
82 // |memory_pressure_listener| indicates memory pressure severity. The | 82 // |memory_pressure_listener| indicates memory pressure severity. The |
83 // |force_instant_gc| is used to force the MSE garbage collection algorithm to | 83 // |force_instant_gc| is used to force the MSE garbage collection algorithm to |
84 // be run right away, without waiting for the next append. | 84 // be run right away, without waiting for the next append. |
85 void OnMemoryPressure( | 85 void OnMemoryPressure( |
86 DecodeTimestamp media_time, | 86 DecodeTimestamp media_time, |
87 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level, | 87 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 | 232 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 |
233 // changes to MSE spec. See http://crbug.com/371499. | 233 // changes to MSE spec. See http://crbug.com/371499. |
234 bool auto_update_timestamp_offset_; | 234 bool auto_update_timestamp_offset_; |
235 | 235 |
236 DISALLOW_COPY_AND_ASSIGN(SourceBufferState); | 236 DISALLOW_COPY_AND_ASSIGN(SourceBufferState); |
237 }; | 237 }; |
238 | 238 |
239 } // namespace media | 239 } // namespace media |
240 | 240 |
241 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ | 241 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ |
OLD | NEW |