Chromium Code Reviews| Index: media/filters/source_buffer_state.cc |
| diff --git a/media/filters/source_buffer_state.cc b/media/filters/source_buffer_state.cc |
| index 5d692c44dde081715cc57842c09a438bb2b590dc..6eed77bbeb661a6b8d2a0c69af91343760205f75 100644 |
| --- a/media/filters/source_buffer_state.cc |
| +++ b/media/filters/source_buffer_state.cc |
| @@ -306,6 +306,19 @@ bool SourceBufferState::EvictCodedFrames(DecodeTimestamp media_time, |
| return success; |
| } |
| +void SourceBufferState::OnMemoryPressure( |
| + DecodeTimestamp media_time, |
| + base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { |
| + // Notify video streams about memory pressure first, since video typically |
| + // takes up the most memory and that's where we can expect most savings. |
|
chcunningham
2017/01/25 03:47:15
I agree about the savings, but I don't follow on t
servolk
2017/01/25 18:06:47
This might make a difference when the instant GC o
chcunningham
2017/01/25 22:21:56
I think this is fine, I just wanted to be sure I w
servolk
2017/01/26 18:10:14
The aggressiveness of GC for audio/text is going t
|
| + for (const auto& it : video_streams_) |
| + it.second->OnMemoryPressure(media_time, memory_pressure_level); |
| + for (const auto& it : audio_streams_) |
| + it.second->OnMemoryPressure(media_time, memory_pressure_level); |
| + for (const auto& it : text_streams_) |
| + it.second->OnMemoryPressure(media_time, memory_pressure_level); |
| +} |
| + |
| Ranges<TimeDelta> SourceBufferState::GetBufferedRanges(TimeDelta duration, |
| bool ended) const { |
| RangesList ranges_list; |