Bug 283235

Summary: VideoMediaSampleRenderer will produce out of order, corrupted frame when used with b-frames.
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: MediaAssignee: 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   

Jean-Yves Avenard [:jya]
Reported 2024-11-16 14:41:11 PST
In https://commits.webkit.org/286106@main (bug 281497) we added support for decoding through a queue to keep track of decoded images by the VideoMediaSampleRenderer. This introduced two issues: 1- The queue used to feed the decoder is a CMBufferQueue which re-order samples in presentation order. So we end up feeding the decoder the frames in presentation order rather than decode order. This causes decoded buffer to be corrupted when using it with H264/H265 content that contains B-frames. 2- The way the WebCoreDecompression is used by the VideoMediaSampleRenderer, it will output frames in decode order which are then fed to an AVSampleBufferDisplay. So we end up having frames being displayed out of order.
Attachments
Radar WebKit Bug Importer
Comment 1 2024-11-16 14:41:33 PST
Jean-Yves Avenard [:jya]
Comment 2 2024-11-17 05:00:18 PST
EWS
Comment 3 2024-11-18 04:23:04 PST
Committed 286719@main (ad4c63c079db): <https://commits.webkit.org/286719@main> Reviewed commits have been landed. Closing PR #36770 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.