KhronosGroup / KhronosGroup/WebGL

Add a getTexParameter enum for the last video frame uploaded to a WebGLTexture

Open
#2,532 10 comments 0 reactions 1 assignee Claimed by @kainino0x View on GitHub
Dominant language
HTML
Stars
2.9k
Forks
703
Avg merge
2d 9h
Merged PRs (30d)
4

Description

Colleagues working on 360 degree videos in WebVR have expressed the need for more metadata associated with each video frame uploaded from an HTMLVideoElement into a WebGLTexture. The form of this metadata has already been proposed in the WEBGL_video_texture extension:
https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/

The same metadata would need to be returned in some way from the existing core WebGL APIs (texImage2D, texSubImage2D) which take HTMLVideoElement as argument.

To avoid modifying the signatures for these methods, @jdashg has proposed adding a new WebGL-specific enum for getTexParameter which would return a "WebGLVideoFrameMetadata" object that's associated with the WebGLTexture object bound to the given target. This would be set when uploading a video frame to the texture, and left as null otherwise. It could be specified to always return the same object for a given WebGLTexture object, to avoid creating garbage in WebAssembly applications. The exact metadata needed will be decided as WEBGL_video_texture is prototyped per #2508. This way, that extension and the core APIs will return the same metadata.

We can start small, and add properties to the object as they're discovered to be necessary. Currently known to be needed are the frame's width, height, and some sort of timestamp, as already documented in WEBGL_video_texture.

CC'ing @grorg @RafaelCintron @zhenyao @kainino0x in particular for further comment.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.