Chromium Code Reviews| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/memory_pressure_listener.h" | |
| 12 #include "media/base/audio_codecs.h" | 13 #include "media/base/audio_codecs.h" |
| 13 #include "media/base/demuxer.h" | 14 #include "media/base/demuxer.h" |
| 14 #include "media/base/demuxer_stream.h" | 15 #include "media/base/demuxer_stream.h" |
| 15 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
| 16 #include "media/base/media_log.h" | 17 #include "media/base/media_log.h" |
| 17 #include "media/base/stream_parser.h" | 18 #include "media/base/stream_parser.h" |
| 18 #include "media/base/stream_parser_buffer.h" | 19 #include "media/base/stream_parser_buffer.h" |
| 19 #include "media/base/video_codecs.h" | 20 #include "media/base/video_codecs.h" |
| 20 | 21 |
| 21 namespace media { | 22 namespace media { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 // Calls Remove(|start|, |end|, |duration|) on all | 69 // Calls Remove(|start|, |end|, |duration|) on all |
| 69 // ChunkDemuxerStreams managed by this object. | 70 // ChunkDemuxerStreams managed by this object. |
| 70 void Remove(TimeDelta start, TimeDelta end, TimeDelta duration); | 71 void Remove(TimeDelta start, TimeDelta end, TimeDelta duration); |
| 71 | 72 |
| 72 // 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 |
| 73 // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec. | 74 // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec. |
| 74 // Returns false iff buffer is still full after running eviction. | 75 // Returns false iff buffer is still full after running eviction. |
| 75 // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction | 76 // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction |
| 76 bool EvictCodedFrames(DecodeTimestamp media_time, size_t newDataSize); | 77 bool EvictCodedFrames(DecodeTimestamp media_time, size_t newDataSize); |
| 77 | 78 |
| 79 void OnMemoryPressure( | |
|
Alexei Svitkine (slow)
2017/01/27 18:03:19
Comment?
servolk
2017/01/28 02:23:57
Done.
| |
| 80 DecodeTimestamp media_time, | |
| 81 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level, | |
| 82 bool force_instant_gc); | |
| 83 | |
| 78 // Returns true if currently parsing a media segment, or false otherwise. | 84 // Returns true if currently parsing a media segment, or false otherwise. |
| 79 bool parsing_media_segment() const { return parsing_media_segment_; } | 85 bool parsing_media_segment() const { return parsing_media_segment_; } |
| 80 | 86 |
| 81 // Sets |frame_processor_|'s sequence mode to |sequence_mode|. | 87 // Sets |frame_processor_|'s sequence mode to |sequence_mode|. |
| 82 void SetSequenceMode(bool sequence_mode); | 88 void SetSequenceMode(bool sequence_mode); |
| 83 | 89 |
| 84 // Signals the coded frame processor to update its group start timestamp to be | 90 // Signals the coded frame processor to update its group start timestamp to be |
| 85 // |timestamp_offset| if it is in sequence append mode. | 91 // |timestamp_offset| if it is in sequence append mode. |
| 86 void SetGroupStartTimestampIfInSequenceMode(base::TimeDelta timestamp_offset); | 92 void SetGroupStartTimestampIfInSequenceMode(base::TimeDelta timestamp_offset); |
| 87 | 93 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 | 226 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 |
| 221 // changes to MSE spec. See http://crbug.com/371499. | 227 // changes to MSE spec. See http://crbug.com/371499. |
| 222 bool auto_update_timestamp_offset_; | 228 bool auto_update_timestamp_offset_; |
| 223 | 229 |
| 224 DISALLOW_COPY_AND_ASSIGN(SourceBufferState); | 230 DISALLOW_COPY_AND_ASSIGN(SourceBufferState); |
| 225 }; | 231 }; |
| 226 | 232 |
| 227 } // namespace media | 233 } // namespace media |
| 228 | 234 |
| 229 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ | 235 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ |
| OLD | NEW |