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

VideoFrames cannot be created asynchronously in WebContent process #33611

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kkinnunen-apple
Copy link
Contributor

@kkinnunen-apple kkinnunen-apple commented Sep 13, 2024

cbe4b09

VideoFrames cannot be created asynchronously in WebContent process
https://bugs.webkit.org/show_bug.cgi?id=279496
rdar://135782380

Reviewed by NOBODY (OOPS!).

GPU process creates VideoFrame instances when camera captures them.
These are offered to WebContent process, and the offer uses identifiers
to reference these. WebContent process would like to also create
VideoFrame instances and pass identifiers to GPU process. Currently this
is done with synchronous messages, so that GPU process allocates the
identifier.

Mark all identifiers allocated by GPUP with top bit == 1. This
guarantees that GPUP can allocate identifiers in its own timeline, and
WCP in its own.

* Source/WTF/wtf/ObjectIdentifier.cpp:
(WTF::initializeObjectIdentifierDomain):
(WTF::ObjectIdentifierMainThreadAccessTraits<uint64_t>::generateIdentifierInternal):
 (WTF::ObjectIdentifierThreadSafeAccessTraits<uint64_t>::generateIdentifierInternal):
 * Source/WTF/wtf/ObjectIdentifier.h:
 * Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm:
 (GPU_SERVICE_INITIALIZER):
 * Source/WebKit/Shared/AuxiliaryProcessMain.h:
 (WebKit::AuxiliaryProcessMainBase::run):
 * Source/WebKit/Shared/ObjectIdentifierDomains.h: Copied from Source/WTF/wtf/ObjectIdentifier.cpp.
 * Source/WebKit/WebKit.xcodeproj/project.pbxproj:

cbe4b09

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 wincairo-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv ✅ 🧪 jsc-armv7-tests
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@kkinnunen-apple kkinnunen-apple self-assigned this Sep 13, 2024
@kkinnunen-apple kkinnunen-apple added the Media Bugs related to the HTML 5 Media elements. label Sep 13, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 13, 2024
https://bugs.webkit.org/show_bug.cgi?id=279496
rdar://135782380

Reviewed by NOBODY (OOPS!).

GPU process creates VideoFrame instances when camera captures them.
These are offered to WebContent process, and the offer uses identifiers
to reference these. WebContent process would like to also create
VideoFrame instances and pass identifiers to GPU process. Currently this
is done with synchronous messages, so that GPU process allocates the
identifier.

Mark all identifiers allocated by GPUP with top bit == 1. This
guarantees that GPUP can allocate identifiers in its own timeline, and
WCP in its own.

* Source/WTF/wtf/ObjectIdentifier.cpp:
(WTF::initializeObjectIdentifierDomain):
(WTF::ObjectIdentifierMainThreadAccessTraits<uint64_t>::generateIdentifierInternal):
 (WTF::ObjectIdentifierThreadSafeAccessTraits<uint64_t>::generateIdentifierInternal):
 * Source/WTF/wtf/ObjectIdentifier.h:
 * Source/WebKit/GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm:
 (GPU_SERVICE_INITIALIZER):
 * Source/WebKit/Shared/AuxiliaryProcessMain.h:
 (WebKit::AuxiliaryProcessMainBase::run):
 * Source/WebKit/Shared/ObjectIdentifierDomains.h: Copied from Source/WTF/wtf/ObjectIdentifier.cpp.
 * Source/WebKit/WebKit.xcodeproj/project.pbxproj:
@kkinnunen-apple kkinnunen-apple removed the merging-blocked Applied to prevent a change from being merged label Sep 13, 2024
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
Development

Successfully merging this pull request may close these issues.

3 participants