VideoSource

interface VideoSource : Source

Produces video frames on a surface for a media mixer.

Use this for creating video sources that depend on the device, such as Camera or MediaProjection. For static images and similar sources, please use the Screen object.

Inheritors

Properties

Link copied to clipboard

The orientation of the video image.

Link copied to clipboard
abstract var surface: Surface?

The surface used as the output destination for video frames.

Link copied to clipboard
open val videoCropRect: Rect?

Valid pixels in the underlying hardware buffer, with exclusive right/bottom coordinates. Supply this when a producer crops from a nonzero origin: ImageReader can report only the cropped dimensions and lose that origin. Null uses the reader's reported crop.

Link copied to clipboard
abstract val videoSize: Size

The resolution of the video frames produced by this source.

Functions

Link copied to clipboard
abstract suspend fun close(): Result<Unit>

Closes the source and returns the result of releasing its capture resources.

Link copied to clipboard
abstract suspend fun open(mixer: MediaMixer): Result<Unit>

Opens the source for the given mixer and returns the result of initialization.