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

Issue 552943002: MSE: Start letting SourceBuffer begin to do initialization segment received algorithm (Closed)

Created:
6 years, 3 months ago by wolenetz
Modified:
6 years, 3 months ago
CC:
blink-reviews, jamesr, eric.carlson_apple.com, abarth-chromium, feature-media-reviews_chromium.org, dglazkov+blink, damienv1, gunsch
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

MSE: Start letting SourceBuffer begin to do initialization segment received algorithm This change is the first in a three-sided set of changes, and introduces WebSourceBufferClient for handling media engine notifications of newly received initialization segments. It adds logic to make the addition of a SourceBuffer into MediaSource.activeSourceBuffers more compliant once all three sides land: addition will be done per the MSE spec's first initialization flag logic rather than other non-compliant approaches like at addSourceBuffer() time or on transition to HAVE_METADATA. Insertion logic is included to preserve correct ordering of activeSourceBuffers. Updated and new layout tests are included. R=acolwell@chromium.org,philipj@opera.com,tkent@chromium.org TEST=No mediasource layout test regression BUG=249428, 397243 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181861

Patch Set 1 #

Patch Set 2 : Updated WIP #

Total comments: 6

Patch Set 3 : Updated WIP (addresses nits), next step will be adding stuff to this CL to let it land as first of … #

Patch Set 4 : Updated to be part 1 of a 3-sided blink->chromium->blink set of changes #

Total comments: 16

Patch Set 5 : Addresses acolwell@'s PS4 nits #

Total comments: 11

Patch Set 6 : Rebased. Addressed philipj@'s PS5 comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -62 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html View 7 chunks +10 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html View 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-buffered.html View 1 7 chunks +65 lines, -21 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-buffered-expected.txt View 1 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-removesourcebuffer.html View 2 chunks +5 lines, -5 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-sourcebufferlist.html View 1 2 3 4 4 chunks +36 lines, -12 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-sourcebufferlist-expected.txt View 1 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-util.js View 1 2 3 4 3 chunks +12 lines, -9 lines 0 comments Download
M Source/modules/mediasource/MediaSource.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/mediasource/MediaSource.cpp View 1 2 3 4 5 2 chunks +26 lines, -1 line 0 comments Download
M Source/modules/mediasource/SourceBuffer.h View 1 2 3 4 4 chunks +6 lines, -1 line 0 comments Download
M Source/modules/mediasource/SourceBuffer.cpp View 1 2 3 4 5 4 chunks +26 lines, -0 lines 0 comments Download
M Source/modules/mediasource/SourceBufferList.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/mediasource/SourceBufferList.cpp View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M public/platform/WebSourceBuffer.h View 1 2 3 4 5 3 chunks +12 lines, -0 lines 0 comments Download
A public/platform/WebSourceBufferClient.h View 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
acolwell GONE FROM CHROMIUM
This looks good to me w/ a few minor nits. https://codereview.chromium.org/552943002/diff/20001/Source/modules/mediasource/MediaSource.cpp File Source/modules/mediasource/MediaSource.cpp (right): https://codereview.chromium.org/552943002/diff/20001/Source/modules/mediasource/MediaSource.cpp#newcode496 ...
6 years, 3 months ago (2014-09-09 22:23:22 UTC) #1
wolenetz
PTAL @ PS4: acolwell@, philipj@: everything (Thank you for earlier reviews, acolwell@!) abarth@: OWNERS review ...
6 years, 3 months ago (2014-09-10 00:42:29 UTC) #3
acolwell GONE FROM CHROMIUM
lgtm % nits https://codereview.chromium.org/552943002/diff/60001/LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html File LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html (right): https://codereview.chromium.org/552943002/diff/60001/LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html#newcode18 LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html:18: assert_equals(xhr.responseType, 'legacystream', 'Verify response type was ...
6 years, 3 months ago (2014-09-10 17:16:27 UTC) #4
wolenetz
philipj@ and abarth@, PTAL @ PS5. philipj: everything abarth: public/ Thanks! https://codereview.chromium.org/552943002/diff/60001/LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html File LayoutTests/http/tests/media/media-source/mediasource-append-legacystream.html (right): ...
6 years, 3 months ago (2014-09-10 21:18:22 UTC) #5
philipj_slow
It's great if you can start the trybots to catch any failing tests early. (I ...
6 years, 3 months ago (2014-09-11 13:02:29 UTC) #6
philipj_slow
LGTM I've read through the code and skimmed the tests, but since I haven't worked ...
6 years, 3 months ago (2014-09-11 13:38:32 UTC) #7
wolenetz
abarth@, PTAL @ patch set 6, as OWNERS reviewer for public/ philipj@: I believe I've ...
6 years, 3 months ago (2014-09-11 21:41:17 UTC) #8
wolenetz
Both abarth@ and jamesr@ have indicated their unavailability to CR the public/platform piece of this ...
6 years, 3 months ago (2014-09-11 23:12:22 UTC) #11
tkent
lgtm
6 years, 3 months ago (2014-09-12 00:25:49 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/552943002/90001
6 years, 3 months ago (2014-09-12 00:27:07 UTC) #14
commit-bot: I haz the power
Committed patchset #6 (id:90001) as 181861
6 years, 3 months ago (2014-09-12 00:36:29 UTC) #15
philipj_slow
6 years, 3 months ago (2014-09-12 08:45:28 UTC) #16
Message was sent while issue was closed.
This has landed, just want to acknowledge that I'm happy with the changes.

https://codereview.chromium.org/552943002/diff/70001/Source/modules/mediasour...
File Source/modules/mediasource/SourceBuffer.cpp (right):

https://codereview.chromium.org/552943002/diff/70001/Source/modules/mediasour...
Source/modules/mediasource/SourceBuffer.cpp:117: ASSERT(!m_webSourceBuffer);
On 2014/09/11 21:41:17, wolenetz wrote:
> On 2014/09/11 13:38:32, philipj wrote:
> > Is this a drive-by fix, or did something change so that this assert now
holds
> > true? I don't see it.
> 
> This is a drive-by for added clarification of |m_webSourceBuffer|'s non-null
> lifetime. If isRemoved() assertion fails, above, this assertion will also fail
> with current code, since removedFromMediaSource() clears both. I'm fine with
> removing this line if you wish.

A little drive-by fixing is fine, just wanted to understand :)

https://codereview.chromium.org/552943002/diff/70001/Source/modules/mediasour...
Source/modules/mediasource/SourceBuffer.cpp:432: // FIXME: Make steps 1-7
synchronous with this call.
On 2014/09/11 21:41:17, wolenetz wrote:
> On 2014/09/11 13:38:32, philipj wrote:
> > Yeah, that algorithm does a lot that's apparently done elsewhere, or not at
> all
> > :)
> 
> I'll be working on subsequent CLs that improve compliance around this.
Chromium
> currently hops threads to set duration and transition to HAVE_METADATA as a
> result of receiving init segment(s). Both, along with adding the necessary
> tracks, would best be done here now that it's plumbed into Blink. |m_source|
> knows the element it's attached to, so I can remove those Chromium thread hops
> (and centralize in a maintainable, readable location the core of the
> initSegmentReceived algorithm.)

Looking forward to those changes!

https://codereview.chromium.org/552943002/diff/70001/public/platform/WebSourc...
File public/platform/WebSourceBuffer.h (right):

https://codereview.chromium.org/552943002/diff/70001/public/platform/WebSourc...
public/platform/WebSourceBuffer.h:72: // The client passed to setClient() should
never be called after this method
On 2014/09/11 21:41:17, wolenetz wrote:
> On 2014/09/11 13:38:32, philipj wrote:
> > I don't understand this comment. Does setClient() transfer ownership of the
> > WebSourceBufferClient to the WebSourceBuffer, but one is allowed to borrow a
> > reference until the removedFromMediaSource() call?
> 
> I've clarified this a bit more. I'm trying to indicate that there is no
> ownership of the WebSourceBufferClient transferred to the WebSourceBuffer by
> setClient(). setClient() passes a raw pointer. The WebSourceBuffer should not
> use this raw pointer after removedFromMediaSource() is called; the pointer is
> only 'valid' between setClient() and removedFromMediaSource(). WebSourceBuffer
> does not own the client object.

That's simple enough, and the updated comments are great, thanks!

Powered by Google App Engine
This is Rietveld 408576698