Bug 253997
| Summary: | MockSourceBufferPrivate should only process samples once init segment has been processed. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Media | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 225367 | ||
Jean-Yves Avenard [:jya]
This blocks bug 225367.
Currently, MockSourceBufferPrivate::append process init and media segments in the same loop. [1]
Immediately after parsing the init segment, it calls SourceBufferPrivate::didReceiveSample
SourceBufferPrivate::didReceiveSample will drop any frames with an unknown track buffer ID. [2]
This is fine when the MockSourceBufferPrivate runs in the content process and the entire append operation is synchronous.
However, when the operation occurs in the GPU Process, the track id will not be usable until the initialisation segment has been sent back to the content process to be processed by the SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment [3] so that it can create a new TrackBuffer.
the SourceBufferPrivateAVFObjC will queue all demuxed frames until after sourceBufferPrivateDidReceiveInitializationSegment has completed (which is an asynchronous operation). and only call SourceBufferPrivate::didReceiveSample once done [4]
[1] https://searchfox.org/wubkat/rev/23d40f46815dafd5828fa1932569943b85f8f24e/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp#141-157
[2] https://searchfox.org/wubkat/rev/23d40f46815dafd5828fa1932569943b85f8f24e/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp#670-679
[3] https://searchfox.org/wubkat/source/Source/WebCore/Modules/mediasource/SourceBuffer.cpp#856-857
[4] https://searchfox.org/wubkat/rev/23d40f46815dafd5828fa1932569943b85f8f24e/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm#466-474
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Jean-Yves Avenard [:jya]
We need to have MockSourceBufferPrivate follow a similar pattern or SourceBufferPrivateAVFObjC ; or preferably have SourceBufferPrivate handle this in a platform agnostic fashion.
The latter allowing to wrap all SourceBufferPrivate implementation in a RemoteSourceBufferPrivate (and run in the GPU Process)
Radar WebKit Bug Importer
<rdar://problem/106784564>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/11599
EWS
Committed 261799@main (30fd635c1cbe): <https://commits.webkit.org/261799@main>
Reviewed commits have been landed. Closing PR #11599 and removing active labels.