Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Issue 794343003: Implement evictFrames() to support MSE's coded frame eviction algorithm. (Closed)

Created:
6 years ago by kjoswiak
Modified:
5 years, 6 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, lcwu1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Implement evictFrames() to support MSE's coded frame eviction algorithm. s/WebKit/Blink/ Implemented WebSourceBufferImpl::evictFrames() to call SourceBuffer::GarbageCollectIfNeeded() Also use playback time in the MSE garbage collection: The MSE spec clearly mentions what should be the state of the media element based on the buffered ranges (see MSE spec 2.4.4 SourceBuffer Monitoring). Since there is a latency between the read position in the source buffer stream and the playback position, the MSE garbage collection must be adjusted so as to not remove the playback position from the buffered ranges.

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : Updated existing SourceBufferStream unittests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+309 lines, -86 lines) Patch
M media/blink/webmediaplayer_impl.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M media/blink/websourcebuffer_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M media/blink/websourcebuffer_impl.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer.h View 4 chunks +16 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer.cc View 5 chunks +46 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer_unittest.cc View 1 6 chunks +54 lines, -10 lines 0 comments Download
M media/filters/source_buffer_range.h View 1 chunk +2 lines, -0 lines 0 comments Download
M media/filters/source_buffer_range.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M media/filters/source_buffer_stream.h View 2 chunks +6 lines, -4 lines 0 comments Download
M media/filters/source_buffer_stream.cc View 1 2 8 chunks +17 lines, -7 lines 0 comments Download
M media/filters/source_buffer_stream_unittest.cc View 1 2 26 chunks +150 lines, -65 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
kjoswiak
Combination of prior CLs https://codereview.chromium.org/791723003/ and https://codereview.chromium.org/789983003/. A more comprehensive rework of the garbage collection ...
6 years ago (2014-12-11 23:25:31 UTC) #2
servolk
We'll need to look into adding more unit tests for GC in SBS, covering this ...
6 years ago (2014-12-12 01:01:53 UTC) #5
kjoswiak
https://codereview.chromium.org/794343003/diff/1/media/filters/source_buffer_stream.cc File media/filters/source_buffer_stream.cc (left): https://codereview.chromium.org/794343003/diff/1/media/filters/source_buffer_stream.cc#oldcode612 media/filters/source_buffer_stream.cc:612: bytes_freed += FreeBuffers(bytes_to_free - bytes_freed, true); On 2014/12/12 01:01:53, ...
6 years ago (2014-12-12 01:22:05 UTC) #6
servolk
5 years, 9 months ago (2015-03-12 18:23:38 UTC) #7
On 2014/12/12 01:22:05, kjoswiak wrote:
>
https://codereview.chromium.org/794343003/diff/1/media/filters/source_buffer_...
> File media/filters/source_buffer_stream.cc (left):
> 
>
https://codereview.chromium.org/794343003/diff/1/media/filters/source_buffer_...
> media/filters/source_buffer_stream.cc:612: bytes_freed +=
> FreeBuffers(bytes_to_free - bytes_freed, true);
> On 2014/12/12 01:01:53, servolk wrote:
> > So now we are never gonna to try freeing buffers from the back? Is it safe?
> What
> > if we are playing at the end of a very long video and then seek back to
> > beginning. I think in the past GC would remove the buffers at the back of
the
> > SBS - how is it gonna be handled now?
> 
> The call to FreeBuffersAfterLastAppended on line 604 should take care of extra
> buffers at end of our ranges.
> 
> This call removes buffers between current playhead and last append, which is
> going to create a gap in the buffer. This is the source of gaps that have been
> causing the playback stall bugs, since most clients are not going to expect
> they're going to have to reappend data in this range.
> 
> I can put this call back in if I'm misunderstanding the situation, but I think
> this is the source of GC over aggression, and would prefer we fail rather than
> try this call.
> 
>
https://codereview.chromium.org/794343003/diff/1/media/filters/source_buffer_...
> File media/filters/source_buffer_stream.cc (right):
> 
>
https://codereview.chromium.org/794343003/diff/1/media/filters/source_buffer_...
> media/filters/source_buffer_stream.cc:612: return (bytes_to_free - bytes_freed
> <= 0);
> On 2014/12/12 01:01:53, servolk wrote:
> > Why not just "return bytes_freed >= bytes_to_free" ? I think that would be
> more
> > readable.
> 
> Done.

Kyle has left Google, continuing this work in a different CL, we still want this
to be fixed in Chromium media pipeline:
https://codereview.chromium.org/1008463002/

Powered by Google App Engine
This is Rietveld 408576698