Bug 227864 - [MSE] sequence mode is broken if GPU Process is enabled
Summary: [MSE] sequence mode is broken if GPU Process is enabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-11 19:35 PDT by Jean-Yves Avenard [:jya]
Modified: 2021-07-15 19:07 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.88 KB, patch)
2021-07-14 04:01 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-07-11 19:35:19 PDT
if sequence mode is explicitly set, or if generate timestamps flag is true (such as when using MSE with raw mpeg audio or aac) each time you call SourceBuffer.appendBuffer the timestampOffset will be amended.

However, if the GPU Process is enabled, then the value of the timestamp offset is only updated in the GPU Process. If we read the value in the web content process, this value will always be 0.
Comment 1 Radar WebKit Bug Importer 2021-07-11 19:35:46 PDT
<rdar://problem/80445041>
Comment 2 Jean-Yves Avenard [:jya] 2021-07-14 03:39:32 PDT
Fly-by notice:

In the spec we read:
3.5.8 Coded Frame Processing
[...]
3.5.8.3 If mode equals "sequence" and group start timestamp is set, then run the following steps:
   1. Set timestampOffset equal to group start timestamp - presentation timestamp.
   2. Set group end timestamp equal to group start timestamp.
   3. Set the need random access point flag on all track buffers to true.
   4, Unset group start timestamp.

But in the code we do:
https://webkit-search.igalia.com/webkit/rev/d08a57141296609b7f8a171e989aa141afa12244/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp#891-892

            // 1.3.1 Set timestampOffset equal to group start timestamp - presentation timestamp.
            m_timestampOffset = m_groupStartTimestamp;

m_timestampOffset isn't set properly here.
Comment 3 Jean-Yves Avenard [:jya] 2021-07-14 04:01:54 PDT
Created attachment 433495 [details]
Patch
Comment 4 EWS 2021-07-15 19:07:54 PDT
Committed r279973 (239716@main): <https://commits.webkit.org/239716@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 433495 [details].