Skip to content

@bvdmitri/web360 / Platform

Interface: Platform ​

Defined in: web360/src/platform.ts:15

What a rendition needs from its environment: decoders, a GPU device, a surface to present on, and two ways to move a decoded frame (onto the GPU, and into a small picture for colour).

Remarks ​

browserPlatform is the browser's (WebCodecs, WebGPU, OffscreenCanvas); a test supplies its own, which is how the rendition loop runs outside a browser.

Properties ​

codecs ​

readonly codecs: Codecs

Defined in: web360/src/platform.ts:17

How decoders and encoded chunks are made.

Methods ​

device() ​

device(): Promise<GPUDevice>

Defined in: web360/src/platform.ts:21

A GPU device; throws a Web360Error when there is none.

Returns ​

Promise<GPUDevice>


ensureDecodable() ​

ensureDecodable(video): Promise<void>

Defined in: web360/src/platform.ts:19

Throws a Web360Error when the video cannot be decoded here.

Parameters ​

video ​

EncodedVideo

Returns ​

Promise<void>


picture() ​

picture(frame, size): LensPicture

Defined in: web360/src/platform.ts:30

A decoded frame drawn small and square, for measuring the lenses' colour.

Parameters ​

frame ​

VideoFrame

size ​

number

Returns ​

LensPicture


presenter() ​

presenter(device, size): Presenter

Defined in: web360/src/platform.ts:23

What the rendered frames are drawn into and handed out from, at the output size.

Parameters ​

device ​

GPUDevice

size ​
height ​

number

width ​

number

Returns ​

Presenter


upload() ​

upload(device, frame, texture): void | Promise<void>

Defined in: web360/src/platform.ts:28

Copies a decoded frame onto a texture; done once a returned promise settles.

Parameters ​

device ​

GPUDevice

frame ​

VideoFrame

texture ​

GPUTexture

Returns ​

void | Promise<void>

Released under the MIT License.