CameraCaptureSource

CameraCaptureSource is an interface for camera capture sources with additional features not covered by VideoCaptureSource.

All the APIs here can be called regardless of whether the AudioVideoFacade is started or not.

Inheritors

Properties

Link copied to clipboard

Content hint for downstream processing

Link copied to clipboard
abstract var device: MediaDevice?

Current camera device. This is only null if the phone/device doesn't have any cameras May be called regardless of whether start or stop has been called.

Link copied to clipboard

Current camera capture format. Actual format may be adjusted to use supported camera formats. May be called regardless of whether start or stop has been called.

Link copied to clipboard
abstract var torchEnabled: Boolean

Toggle for torch on the current device. Will succeed if current device has access to flashlight, otherwise will stay false. May be called regardless of whether start or stop has been called.

Functions

Link copied to clipboard

Add a capture source observer to receive callbacks from the source on lifecycle events which can be used to trigger UI. This observer is entirely optional.

Link copied to clipboard
abstract fun addVideoSink(sink: VideoSink)

Add a video sink which will immediately begin to receive new frames.

Link copied to clipboard

Remove a capture source observer

Link copied to clipboard
abstract fun removeVideoSink(sink: VideoSink)

Remove a video sink which will no longer receive new frames on return

Link copied to clipboard
abstract fun setMaxResolution(maxResolution: VideoResolution)

Set max resolution for video capture source DefaultCameraCaptureSource and DefaultScreenCaptureSource call this function to set max resolution for camera and screen capture

Link copied to clipboard
abstract fun start()

Start capturing on this source and emitting video frames

Link copied to clipboard
abstract fun stop()

Stop capturing on this source and cease emitting video frames

Link copied to clipboard
abstract fun switchCamera()

Helper function to switch from front to back cameras or reverse. This also switches from any external cameras to the front camera.