CameraCapturerUtils

Various utils for handling camera capturers.

Types

Link copied to clipboard
interface CameraProvider

An interface declaring a provider of camera capturers.

Functions

Link copied to clipboard

Creates a Camera capturer.

Link copied to clipboard
fun createCameraEnumerator(context: Context): CameraEnumerator

Obtain a CameraEnumerator based on platform capabilities.

Link copied to clipboard
fun CameraEnumerator.findCamera(predicate: (deviceName: String) -> Boolean): String?

Finds the device id of a camera that matches the predicate.

fun CameraEnumerator.findCamera(deviceId: String? = null, position: CameraPosition? = null, fallback: Boolean = true): String?

Finds the device id of first available camera based on the criteria given. Returns null if no camera matches the criteria.

Link copied to clipboard
fun CameraEnumerator.getCameraPosition(deviceName: String?): CameraPosition?

Returns the camera position of a camera, or null if neither front or back facing (e.g. external camera).

Link copied to clipboard

Register external camera provider

Link copied to clipboard

Unregister external camera provider