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

Issue 1013923002: Fix MSE GC, make it less aggressive, more spec-compliant (Blink CL) (Closed)

Created:
5 years, 9 months ago by servolk
Modified:
5 years, 4 months ago
CC:
blink-reviews, feature-media-reviews_chromium.org, dglazkov+blink, eric.carlson_apple.com
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix MSE GC, make it less aggressive, more spec-compliant (Blink CL) Provided interface in ChunkDemuxer/WebSourceBuffer to allow blink to invoke "3.5.12 Coded Frame Eviction Algorithm" https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction This allows us to detect when buffer is full, even after GC and throw QuotaExceededErr exception as MSE spec prescribes. See step #6 in section 3.5.4 at https://w3c.github.io/media-source/#sourcebuffer-prepare-append Related Chromium CL: https://codereview.chromium.org/1008463002/ BUG=421694 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200989

Patch Set 1 #

Patch Set 2 : Rebase to ToT #

Patch Set 3 : Added a basic test for evict frames functionality #

Total comments: 10

Patch Set 4 : Added QuotaExceededErr test case for appendStream #

Patch Set 5 : Added decodeError parameter for appendError function #

Total comments: 4

Patch Set 6 : Refactoring #

Patch Set 7 : Removed TODO, implemented calling m_source->endOfStream #

Patch Set 8 : Pass currentTime from blink level, instead of using GetMediaTimeCB #

Total comments: 30

Patch Set 9 : CR feedback #

Total comments: 22

Patch Set 10 : Increase test performance by using larger input file + CR feedback #

Patch Set 11 : Split unit tests for appendBuffer/Stream into separate files #

Patch Set 12 : Pass new data size into evictCodedFrames #

Patch Set 13 : Rebase to ToT + a bit more logging #

Patch Set 14 : Use smaller data file for separate tests #

Total comments: 5

Patch Set 15 : Split LayoutTests into a separate CL #

Patch Set 16 : Moved evictCodedFrames invocation to SourceBuffer::didReceiveDataForClient #

Patch Set 17 : Adjust comments #

Patch Set 18 : m_loader might be released before didFail, if appendStream failed due to full buffer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -39 lines) Patch
M Source/modules/mediasource/MediaSource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/mediasource/MediaSource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -0 lines 0 comments Download
M Source/modules/mediasource/SourceBuffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M Source/modules/mediasource/SourceBuffer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 chunks +111 lines, -39 lines 0 comments Download
M public/platform/WebSourceBuffer.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (4 generated)
servolk
5 years, 6 months ago (2015-05-29 23:30:27 UTC) #3
philipj_slow
Looks good, can you take a look too, wolenetz@? https://codereview.chromium.org/1013923002/diff/40001/Source/modules/mediasource/SourceBuffer.cpp File Source/modules/mediasource/SourceBuffer.cpp (left): https://codereview.chromium.org/1013923002/diff/40001/Source/modules/mediasource/SourceBuffer.cpp#oldcode718 Source/modules/mediasource/SourceBuffer.cpp:718: ...
5 years, 6 months ago (2015-06-01 14:37:27 UTC) #4
servolk
https://codereview.chromium.org/1013923002/diff/40001/Source/modules/mediasource/SourceBuffer.cpp File Source/modules/mediasource/SourceBuffer.cpp (right): https://codereview.chromium.org/1013923002/diff/40001/Source/modules/mediasource/SourceBuffer.cpp#newcode536 Source/modules/mediasource/SourceBuffer.cpp:536: exceptionState.throwDOMException(QuotaExceededError, "The SourceBuffer is full, and cannot free space ...
5 years, 6 months ago (2015-06-02 19:24:31 UTC) #5
servolk
https://codereview.chromium.org/1013923002/diff/40001/Source/modules/mediasource/SourceBuffer.cpp File Source/modules/mediasource/SourceBuffer.cpp (right): https://codereview.chromium.org/1013923002/diff/40001/Source/modules/mediasource/SourceBuffer.cpp#newcode667 Source/modules/mediasource/SourceBuffer.cpp:667: exceptionState.throwDOMException(QuotaExceededError, "The SourceBuffer is full, and cannot free space ...
5 years, 6 months ago (2015-06-02 23:50:05 UTC) #6
philipj_slow
Thanks, code-wise I think this looks right. The testing seems a bit tricky, if you'd ...
5 years, 6 months ago (2015-06-03 12:43:32 UTC) #7
wolenetz
On 2015/06/03 12:43:32, philipj wrote: > Thanks, code-wise I think this looks right. The testing ...
5 years, 6 months ago (2015-06-04 00:56:26 UTC) #8
wolenetz
Looks pretty good. It needs the ExceptionState parameter fixed per philipj's reply. Thanks for working ...
5 years, 6 months ago (2015-06-04 00:58:14 UTC) #9
philipj_slow
On 2015/06/04 00:56:26, wolenetz wrote: > On 2015/06/03 12:43:32, philipj wrote: > > Thanks, code-wise ...
5 years, 6 months ago (2015-06-04 11:19:14 UTC) #10
wolenetz
On 2015/06/04 11:19:14, philipj wrote: > On 2015/06/04 00:56:26, wolenetz wrote: > > On 2015/06/03 ...
5 years, 6 months ago (2015-06-04 18:34:49 UTC) #11
philipj_slow
On 2015/06/04 18:34:49, wolenetz wrote: > On 2015/06/04 11:19:14, philipj wrote: > > On 2015/06/04 ...
5 years, 6 months ago (2015-06-04 18:45:04 UTC) #12
servolk
On 2015/06/04 18:45:04, philipj wrote: > On 2015/06/04 18:34:49, wolenetz wrote: > > On 2015/06/04 ...
5 years, 6 months ago (2015-06-04 18:53:40 UTC) #13
servolk
On 2015/06/04 18:34:49, wolenetz wrote: > On 2015/06/04 11:19:14, philipj wrote: > > On 2015/06/04 ...
5 years, 6 months ago (2015-06-04 18:56:57 UTC) #14
servolk
https://codereview.chromium.org/1013923002/diff/80001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html (right): https://codereview.chromium.org/1013923002/diff/80001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode81 LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html:81: }, 'Calling appendStream repeatedly should fill up the buffer ...
5 years, 6 months ago (2015-06-18 23:23:28 UTC) #15
philipj_slow
Sorry, this has been sitting idle for a while. Is it now waiting for final ...
5 years, 5 months ago (2015-06-29 07:29:37 UTC) #16
servolk
On 2015/06/29 07:29:37, philipj wrote: > Sorry, this has been sitting idle for a while. ...
5 years, 5 months ago (2015-06-29 23:49:07 UTC) #17
servolk
On 2015/06/29 23:49:07, servolk wrote: > On 2015/06/29 07:29:37, philipj wrote: > > Sorry, this ...
5 years, 5 months ago (2015-06-29 23:55:23 UTC) #18
philipj_slow
On 2015/06/29 23:49:07, servolk wrote: > On 2015/06/29 07:29:37, philipj wrote: > > Sorry, this ...
5 years, 5 months ago (2015-07-02 09:27:46 UTC) #19
philipj_slow
Took another look at the code, but haven't looked at the test this time. https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/MediaSource.h ...
5 years, 5 months ago (2015-07-02 09:48:22 UTC) #20
servolk
https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/MediaSource.h File Source/modules/mediasource/MediaSource.h (right): https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/MediaSource.h#newcode104 Source/modules/mediasource/MediaSource.h:104: HTMLMediaElement* getHTMLMediaElement() const; On 2015/07/02 09:48:21, philipj wrote: > ...
5 years, 5 months ago (2015-07-07 23:01:52 UTC) #21
servolk
On 2015/07/02 09:27:46, philipj wrote: > On 2015/06/29 23:49:07, servolk wrote: > > On 2015/06/29 ...
5 years, 5 months ago (2015-07-08 01:18:40 UTC) #22
philipj_slow
On 2015/07/08 01:18:40, servolk wrote: > Regarding the test performance, the test does seem to ...
5 years, 5 months ago (2015-07-08 12:31:55 UTC) #23
philipj_slow
https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/SourceBuffer.cpp File Source/modules/mediasource/SourceBuffer.cpp (right): https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/SourceBuffer.cpp#newcode804 Source/modules/mediasource/SourceBuffer.cpp:804: // 11. If the buffer full flag equals true, ...
5 years, 5 months ago (2015-07-08 12:47:44 UTC) #24
servolk
On 2015/07/08 12:31:55, philipj wrote: > On 2015/07/08 01:18:40, servolk wrote: > > Regarding the ...
5 years, 5 months ago (2015-07-08 18:33:39 UTC) #25
servolk
https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/SourceBuffer.cpp File Source/modules/mediasource/SourceBuffer.cpp (right): https://codereview.chromium.org/1013923002/diff/140001/Source/modules/mediasource/SourceBuffer.cpp#newcode804 Source/modules/mediasource/SourceBuffer.cpp:804: // 11. If the buffer full flag equals true, ...
5 years, 5 months ago (2015-07-08 19:03:48 UTC) #26
ddorwin
https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html (right): https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode48 LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html:48: xhr.responseType = 'legacystream'; Is there a reason you are ...
5 years, 5 months ago (2015-07-08 19:04:51 UTC) #28
servolk
https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html (right): https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode48 LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html:48: xhr.responseType = 'legacystream'; On 2015/07/08 19:04:51, ddorwin wrote: > ...
5 years, 5 months ago (2015-07-08 19:13:00 UTC) #29
ddorwin
https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html (right): https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode48 LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html:48: xhr.responseType = 'legacystream'; On 2015/07/08 19:13:00, servolk wrote: > ...
5 years, 5 months ago (2015-07-08 19:24:09 UTC) #30
servolk
https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html (right): https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode48 LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html:48: xhr.responseType = 'legacystream'; On 2015/07/08 19:24:09, ddorwin wrote: > ...
5 years, 5 months ago (2015-07-08 20:58:26 UTC) #31
philipj_slow
https://codereview.chromium.org/1013923002/diff/140001/public/platform/WebSourceBuffer.h File public/platform/WebSourceBuffer.h (right): https://codereview.chromium.org/1013923002/diff/140001/public/platform/WebSourceBuffer.h#newcode57 public/platform/WebSourceBuffer.h:57: // |currentPlaybackTime| is HTMLMediaElement::currentTime. The algorithm On 2015/07/08 19:03:47, ...
5 years, 5 months ago (2015-07-09 09:49:23 UTC) #32
philipj_slow
https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html (right): https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode69 LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html:69: sourceBuffer.appendStream(xhr.response); On 2015/07/08 20:58:26, servolk wrote: > On 2015/07/08 ...
5 years, 5 months ago (2015-07-09 09:56:05 UTC) #33
servolk
On 2015/07/09 09:56:05, philipj wrote: > https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html > File LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html > (right): > > https://codereview.chromium.org/1013923002/diff/160001/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html#newcode69 ...
5 years, 5 months ago (2015-07-10 01:11:18 UTC) #34
servolk
https://codereview.chromium.org/1013923002/diff/140001/public/platform/WebSourceBuffer.h File public/platform/WebSourceBuffer.h (right): https://codereview.chromium.org/1013923002/diff/140001/public/platform/WebSourceBuffer.h#newcode57 public/platform/WebSourceBuffer.h:57: // |currentPlaybackTime| is HTMLMediaElement::currentTime. The algorithm On 2015/07/09 09:49:23, ...
5 years, 5 months ago (2015-07-10 01:11:28 UTC) #35
philipj_slow
https://codereview.chromium.org/1013923002/diff/140001/public/platform/WebSourceBuffer.h File public/platform/WebSourceBuffer.h (right): https://codereview.chromium.org/1013923002/diff/140001/public/platform/WebSourceBuffer.h#newcode57 public/platform/WebSourceBuffer.h:57: // |currentPlaybackTime| is HTMLMediaElement::currentTime. The algorithm On 2015/07/10 01:11:27, ...
5 years, 5 months ago (2015-07-10 08:40:27 UTC) #36
philipj_slow
Split tests look good, BTW.
5 years, 5 months ago (2015-07-10 08:43:34 UTC) #37
wolenetz
At long last, and with apologies for delay, my CR comments: (Also, what is your ...
5 years, 4 months ago (2015-08-12 22:42:04 UTC) #38
servolk
FYI: After discussing offline with wolenetz@ how we can land this safely without breaking anything ...
5 years, 4 months ago (2015-08-21 02:05:08 UTC) #39
servolk
https://codereview.chromium.org/1013923002/diff/160001/Source/modules/mediasource/SourceBuffer.cpp File Source/modules/mediasource/SourceBuffer.cpp (right): https://codereview.chromium.org/1013923002/diff/160001/Source/modules/mediasource/SourceBuffer.cpp#newcode769 Source/modules/mediasource/SourceBuffer.cpp:769: m_webSourceBuffer->abort(); On 2015/08/12 22:42:03, wolenetz wrote: > On 2015/07/10 ...
5 years, 4 months ago (2015-08-21 02:51:25 UTC) #40
philipj_slow
Recent changes (and thus the whole CL) LGTM.
5 years, 4 months ago (2015-08-21 08:21:06 UTC) #41
philipj_slow
Sending to CQ to improve chances of beating the branch point. Matt, if you had ...
5 years, 4 months ago (2015-08-21 08:28:05 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1013923002/330001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1013923002/330001
5 years, 4 months ago (2015-08-21 15:04:32 UTC) #44
commit-bot: I haz the power
Committed patchset #18 (id:330001) as https://src.chromium.org/viewvc/blink?view=rev&revision=200989
5 years, 4 months ago (2015-08-21 16:10:18 UTC) #45
wolenetz
5 years, 4 months ago (2015-08-21 19:33:02 UTC) #46
Message was sent while issue was closed.
lgtm

https://codereview.chromium.org/1013923002/diff/260001/Source/modules/mediaso...
File Source/modules/mediasource/SourceBuffer.cpp (right):

https://codereview.chromium.org/1013923002/diff/260001/Source/modules/mediaso...
Source/modules/mediasource/SourceBuffer.cpp:789: if (decodeError)
On 2015/08/21 02:51:25, servolk wrote:
> On 2015/08/12 22:42:04, wolenetz wrote:
> > This is interesting that Blink didn't do this previously. Internally in
> > Chromium, we bubble the error through the pipeline / mediasourcedelegate, Do
> we
> > need a new layout test added to confirm failed append does the right thing
to
> > the state of m_source?
> 
> This is a new method that was introduced in this CL, so currently it is only
> going to be invoked from one place (didFinishLoading via appendStreamDone) and
> decodeError will always be false for now. But later we can re-route the actual
> decode errors, which are handled through a different code path, through
> SourceBuffer::appendError as well.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698