VideoFrameProcessor

fun interface VideoFrameProcessor

Transforms captured camera frames before they are encoded — a background blur, a colour filter, an overlay.

Install with Room.setVideoProcessor and remove with Room.removeVideoProcessor. One processor at a time: installing one replaces the last. It processes the camera from the moment it is installed, a pre-join preview included, until it is removed or the room is left. Screen-share frames never pass through it.

Installing one takes the camera off its zero-copy path: every frame is copied into an I420 buffer first, which costs CPU whether or not you change anything.

Functions

Link copied to clipboard
abstract fun onFrameCaptured(videoFrame: VideoFrame): VideoFrame

Called for every captured camera frame. Return the frame unchanged, or a new one.