mirror of
https://github.com/electron/electron.git
synced 2026-01-14 18:08:07 -05:00
2.0 KiB
2.0 KiB
SharedTextureImportedSubtle Object
getVideoFrameFunction<VideoFrame> - Create aVideoFramethat uses the imported shared texture in the current process. You can callVideoFrame.close()once you've finished using the object. The underlying resources will wait for GPU finish internally.releaseFunction - Release the resources. If you transferred and get multipleSharedTextureImportedobjects, you have toreleaseevery one of them. The resource on the GPU process will be destroyed when the last one is released.callbackFunction (optional) - Callback when the GPU command buffer finishes using this shared texture. It provides a precise event to safely release dependent resources. For example, if this object is created byfinishTransferSharedTexture, you can use this callback to safely release the original one that calledstartTransferSharedTexturein other processes. You can also release the source shared texture that was used toimportSharedTexturesafely.
startTransferSharedTextureFunction<SharedTextureTransfer> - Create aSharedTextureTransferthat can be serialized and transferred to other processes.getFrameCreationSyncTokenFunction<SharedTextureSyncToken> - This method is for advanced users. If used, it is typically called afterfinishTransferSharedTexture, and should be passed to the object which was calledstartTransferSharedTextureto prevent the source object release the underlying resource before the target object actually acquire the reference at gpu process asyncly.setReleaseSyncTokenFunction - This method is for advanced users. If used, this object's underlying resource will not be released until the set sync token is fulfilled at gpu process. By using sync tokens, users are not required to use release callbacks for lifetime management.syncTokenSharedTextureSyncToken - The sync token to set.