Chromium Code Reviews| Index: media/filters/chunk_demuxer.h |
| diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h |
| index 020aa1417e4198da25871326c37fee2511d2c9a7..53d0e874ecef49b3c10f8b05ca163c59be82b4be 100644 |
| --- a/media/filters/chunk_demuxer.h |
| +++ b/media/filters/chunk_demuxer.h |
| @@ -16,6 +16,7 @@ |
| #include <vector> |
| #include "base/macros.h" |
| +#include "base/memory/memory_pressure_listener.h" |
| #include "base/synchronization/lock.h" |
| #include "media/base/byte_queue.h" |
| #include "media/base/demuxer.h" |
| @@ -60,11 +61,16 @@ class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream { |
| void Remove(base::TimeDelta start, base::TimeDelta end, |
| base::TimeDelta duration); |
| - // If the buffer is full, attempts to try to free up space, as specified in |
| - // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec. |
| + // Runs the "Coded Frame Eviction Algorithm" from the Media Source Extensions |
| + // spec: https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
| + // |eviction_size| is an input parameter specifying how much space we want to |
| + // be available in the buffer after eviction. |
| + // |bytes_released| is an optional output parameter, if non-null it will |
| + // indicate how much buffer space was actually released. |
| // Returns false iff buffer is still full after running eviction. |
| - // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
| - bool EvictCodedFrames(DecodeTimestamp media_time, size_t newDataSize); |
| + bool EvictCodedFrames(DecodeTimestamp media_time, |
| + size_t eviction_size, |
| + size_t* bytes_released = nullptr); |
| // Signal to the stream that duration has changed to |duration|. |
| void OnSetDuration(base::TimeDelta duration); |
| @@ -118,6 +124,7 @@ class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream { |
| // Sets the memory limit, in bytes, on the SourceBufferStream. |
| void SetStreamMemoryLimit(size_t memory_limit); |
| + size_t stream_memory_limit() const; |
| bool supports_partial_append_window_trimming() const { |
| return partial_append_window_trimming_enabled_; |
| @@ -262,13 +269,20 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { |
| void Remove(const std::string& id, base::TimeDelta start, |
| base::TimeDelta end); |
| - // If the buffer is full, attempts to try to free up space, as specified in |
| - // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec. |
| + // Runs the "Coded Frame Eviction Algorithm" from the Media Source Extensions |
| + // spec: https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
| + // |eviction_size| is an input parameter specifying how much space we want to |
| + // be available in the buffer after eviction. |
| + // |bytes_released| is an optional output parameter, if non-null it will |
|
wolenetz
2017/01/12 22:21:49
Where is this param decl'ed?
servolk
2017/01/12 22:58:41
Oops, I've copy/pasted this comment from ChunkDemu
|
| + // indicate how much buffer space was actually released. |
| // Returns false iff buffer is still full after running eviction. |
| - // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
| bool EvictCodedFrames(const std::string& id, |
| base::TimeDelta currentMediaTime, |
| - size_t newDataSize); |
| + size_t eviction_size); |
| + |
| + void OnMemoryPressure( |
| + base::TimeDelta currentMediaTime, |
| + base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| // Returns the current presentation duration. |
| double GetDuration(); |