Use VolatileBuffers for MSE ResourceQueue storage

RESOLVED INVALID

Status

()

defect
P5
normal
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: mattwoodrow, Unassigned)

Tracking

(Blocks 1 bug)

29 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

5 years ago
VolatileBuffers let the OS reclaim memory (from unlocked buffers) when it needs to. This would let us significantly increase the eviction threshold (or possibly remove it entirely).

I think the simplest thing to do would be to ensure that all data from the current time (according to SourceBufferResource::mOffset) onwards is always locked, so that we only ever get earlier data discarded.

We'd need to add a way to request locking from a specific position (or possibly just implement Pin/Unpin), so that MediaSourceReader::Seek can ensure that we don't discard the same data that we're waiting on.

SourceBufferResource::GetCachedRanges would also need to iterate over the segments (up until we get to mOffset) and check that they haven't been discarded.

There may be other changes required since the buffer isn't necessarily contiguous anymore.

Testing this will be hard. I think we'll still want to listen for memory-pressure events, since not all platforms implement VolatileBuffers in a useful way.
Reporter

Comment 1

5 years ago
The MSE spec requires that we only discard data during an update, so this would violate the spec.
Reporter

Updated

5 years ago
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.