Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface VideoFrameBuffer

VideoFrameBuffer is an interface that can be used as input or output with VideoFrameProcessor. It must implement the method to return buffer as CanvasImageSource but the internal handle to the video frame buffer can be flexible.

Hierarchy

  • VideoFrameBuffer

Implemented by

Index

Properties

framerate

framerate: number

The frame rate of the source in the VideoFrameBuffer.

height

height: number

The height in pixels of the source in the VideoFrameBuffer.

width

width: number

The width in pixels of the source in the VideoFrameBuffer.

Methods

Optional asCanvasElement

  • asCanvasElement(): HTMLCanvasElement | OffscreenCanvas
  • Returns HTMLCanvasElement or OffscreenCanvas if the internal source can be transformed into one. Optional method. Returns null if the buffer is destroyed.

    Returns HTMLCanvasElement | OffscreenCanvas

asCanvasImageSource

  • asCanvasImageSource(): Promise<CanvasImageSource>
  • Returns the buffer as CanvasImageSource which can be drawn on HTMLCanvasElement directly. If destroy is already called, asCanvasImageSource should reject.

    Returns Promise<CanvasImageSource>

Optional asTransferable

  • asTransferable(): Promise<Transferable>
  • Returns [[Transferable]] if the internal source can be transformed into one. Optional method. If destroy is already called, asTransferable should reject.

    Returns Promise<Transferable>

destroy

  • destroy(): void

Generated using TypeDoc