Skip to content

Commit

Permalink
Define importing VideoFrame into WebGPU
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Nov 25, 2021
1 parent ff5738b commit 3da61af
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -3772,6 +3772,26 @@
{{ImageBitmapOptions}} {{ImageBitmapOptions/colorSpaceConversion}}. Setting this
value to "none" disables color space conversion.

### WebGPU ### {#videoframe-webgpu}

[[WebGPU]] is extended to allow importing {{VideoFrame}} objects via
{{GPUDevice/importExternalTexture())}, producing opaque {{GPUExternalTexture}}
objects, which can be read from WebGPU shaders.
The definition of the {{GPUExternalTextureDescriptor/source}} member of
{{GPUExternalTextureDescriptor}} is modified to allow {{VideoFrame}}:

<xmp>
partial dictionary GPUExternalTextureDescriptor {
required (HTMLVideoElement or VideoFrame) source;
};
</xmp>

The lifetime of such a {{GPUExternalTexture}} object is implicitly tied to the
lifetime of the source {{VideoFrame}} object.
When the {{VideoFrame}} is [=Close VideoFrame|closed=] (implicitly or
explicitly), the {{GPUExternalTexture}} is *destroyed*, so no further operations
using it can be issued.

VideoFrame CopyTo() Options {#videoframe-copyto-options}
------------------------------------------------------------
Options to specify a rectangle of pixels to copy and the offset and stride of
Expand Down

0 comments on commit 3da61af

Please sign in to comment.