-
Notifications
You must be signed in to change notification settings - Fork 9
rfc: Import Shared Texture #17
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
base: main
Are you sure you want to change the base?
Conversation
0c30774
to
05b8645
Compare
I decided to add 2 methods about passing |
Ready for review! I significantly polished up my API design, providing a more straight forward way to use, and use Electron IPC to automatically manage lifecycles for user. |
18ce4d7
to
3c670e3
Compare
* `importedSharedTexture` [SharedTextureImported](#sharedtextureimported-object) - The imported shared texture. | ||
* `...args` any[] - Additional arguments to pass to the renderer process. | ||
|
||
Send the imported shared texture to a renderer process. You must register receiver at renderer process before calling this method. This method has a timeout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method has a timeout.
What would cause this method to time out? Is the timeout configurable, or is it just a fixed timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently it is set to 1000ms if the renderer process doesn't reply in this amount of time. The renderer process need to reply a sync token to main process to 1) make sure it received 2) extend the lifetime of main process's Chromium resource. (i.e. prevent SharedImage ref count -> 0 until renderer process done ref count +1, at gpu side, asyncly)
I think 1000ms is large enough, so I didn't make it configurable.
This feature provides a way to import a native shared texture handle into Electron, specifically in the form of VideoFrame, which by nature supports several Web rendering systems including
WebGPU
,WebGL
. This enables developers to integrate arbitrary native rendered content with their web applications.