Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedVideoFrameWriter can hang on its semaphore in case of bad CVPixelBuffers #2072

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Jul 5, 2022

688b368

SharedVideoFrameWriter can hang on its semaphore in case of bad CVPixelBuffers
https://bugs.webkit.org/show_bug.cgi?id=242334
rdar://95326241

Reviewed by Eric Carlson.

Before writing to shared memory, the writer is waiting on its counterpart reader to signal that memory can be written.
This works fine except if the writer fails to write data, in which case the reader will not notify that memory can be written.
Write failure for instance happens if data cannot be read from the pixel buffer.
To fix this, the writer will signal its semaphore that it does not need to wait in case of write failure.

* Source/WebKit/WebProcess/GPU/webrtc/SharedVideoFrame.cpp:
(WebKit::SharedVideoFrameWriter::wait):
(WebKit::SharedVideoFrameWriter::prepareWriting):
(WebKit::SharedVideoFrameWriter::writeBuffer):
(WebKit::SharedVideoFrameWriter::signalInCaseOfError):
* Source/WebKit/WebProcess/GPU/webrtc/SharedVideoFrame.h:

Canonical link: https://commits.webkit.org/252136@main

@youennf youennf self-assigned this Jul 5, 2022
@youennf youennf added Media Bugs related to the HTML 5 Media elements. WebKit Nightly Build labels Jul 5, 2022
@youennf youennf requested a review from eric-carlson July 5, 2022 11:32
@youennf youennf added the merge-queue Applied to send a pull request to merge-queue label Jul 5, 2022
…elBuffers

https://bugs.webkit.org/show_bug.cgi?id=242334
rdar://95326241

Reviewed by Eric Carlson.

Before writing to shared memory, the writer is waiting on its counterpart reader to signal that memory can be written.
This works fine except if the writer fails to write data, in which case the reader will not notify that memory can be written.
Write failure for instance happens if data cannot be read from the pixel buffer.
To fix this, the writer will signal its semaphore that it does not need to wait in case of write failure.

* Source/WebKit/WebProcess/GPU/webrtc/SharedVideoFrame.cpp:
(WebKit::SharedVideoFrameWriter::wait):
(WebKit::SharedVideoFrameWriter::prepareWriting):
(WebKit::SharedVideoFrameWriter::writeBuffer):
(WebKit::SharedVideoFrameWriter::signalInCaseOfError):
* Source/WebKit/WebProcess/GPU/webrtc/SharedVideoFrame.h:

Canonical link: https://commits.webkit.org/252136@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/SharedVideoFrameWriter-can-hang-on-its-semaphore-in-case-of-bad-CVPixelBuffers branch from 5a6a6a7 to 688b368 Compare July 5, 2022 15:49
@webkit-commit-queue
Copy link
Collaborator

Committed 252137@main (b823acb): https://commits.webkit.org/252137@main

Reviewed commits have been landed. Closing PR #2072 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Media Bugs related to the HTML 5 Media elements.
Projects
None yet
3 participants