Interface VideoFrameProcessor

[[VideoFrameProcessor]] is defined as a unit of video processing. It transforms an array of VideoFrameBuffer and produces an array of VideoFrameBuffer. It can be chained together to be used with VideoFrameProcessorPipeline.

interface VideoFrameProcessor {
    destroy(): Promise<void>;
    process(buffers: VideoFrameBuffer[]): Promise<VideoFrameBuffer[]>;
    setEventController(eventController: EventController): void;
    stopTransformTrack(): Promise<void>;
    transformTrack(input: MediaStreamTrack): Promise<MediaStreamTrack>;
}

Hierarchy (View Summary)

Implemented by

Methods

  • Optional. Processes the frames of input and resolves with the processed video track. DefaultVideoTransformDevice calls it instead of process when every processor implements it.

    • Rejects if processing cannot start.
    • Calling it again with a new input, before stopTransformTrack, resolves with the same output track.
    • Does not stop input, and processes the black frames of a disabled input like any other.
    • When processing fails for good, end the output track (so that it fires ended); the device then calls stopTransformTrack and continues with process.

    Parameters

    • input: MediaStreamTrack

    Returns Promise<MediaStreamTrack>