sharedTexture
Import shared textures into Electron and converts platform specific handles into
VideoFrame. Supports all Web rendering systems, and can be transferred across Electron processes. Read here for more information.
Methods
The sharedTexture module has the following methods:
Note: Experimental APIs are marked as such and could be removed in the future.
sharedTexture.importSharedTexture(options) Experimental
Imports the shared texture from the given options.
This method is only available in the main process.
Returns SharedTextureImported - The imported shared texture.
sharedTexture.sendSharedTexture(options, ...args) Experimental
...argsany[] - Additional arguments to pass to the renderer process.
Send the imported shared texture to a renderer process. You must register a receiver at renderer process before calling this method. This method has a 1000ms timeout. Ensure the receiver is set and the renderer process is alive before calling this method.
This method is only available in the main process.
Returns Promise<void> - Resolves when the transfer is complete.
sharedTexture.setSharedTextureReceiver(callback) Experimental
callbackFunction<Promise<void>> - The function to receive the imported shared texture.receivedSharedTextureDataObject - The data received from the main process.importedSharedTextureSharedTextureImported - The imported shared texture.
...argsany[] - Additional arguments passed from the main process.
Set a callback to receive imported shared textures from the main process.
This method is only available in the renderer process.
Properties
The sharedTexture module has the following properties:
sharedTexture.subtle Experimental
A SharedTextureSubtle property, provides subtle APIs for interacting with shared texture for advanced users.