CameraAdapter

abstract class CameraAdapter<CameraOutput> : LifecycleObserver

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun bindToLifecycle(lifecycleOwner: LifecycleOwner)

Bind this camera manager to a lifecycle.

Link copied to clipboard
abstract fun changeCamera()

Change to a new camera.

Link copied to clipboard
abstract fun getCurrentCamera(): Int

Determine which camera is currently in use.

Link copied to clipboard
fun getImageStream(): Flow<CameraOutput>

Get the stream of images from the camera. This is a hot Flow of images with a back pressure strategy DROP. Images that are not read from the flow are dropped. This flow is backed by a Channel.

Link copied to clipboard
open fun isBoundToLifecycle(): Boolean

Determine if the adapter is currently bound.

Link copied to clipboard
abstract fun isTorchOn(): Boolean

Determine if the torch is currently on.

Link copied to clipboard
fun onDestroyed()
Link copied to clipboard
open fun onPause()
Link copied to clipboard
abstract fun setFocus(point: PointF)

Set the focus on a particular point on the screen.

Link copied to clipboard
abstract fun setTorchState(on: Boolean)

Turn the camera torch on or off.

Link copied to clipboard
open fun unbindFromLifecycle(lifecycleOwner: LifecycleOwner)

Unbind this camera from a lifecycle. This will pause the camera.

Link copied to clipboard
abstract fun withFlashSupport(task: (Boolean) -> Unit)

Execute a task with flash support.

Link copied to clipboard
abstract fun withSupportsMultipleCameras(task: (Boolean) -> Unit)

Determine if the device has multiple cameras.

Properties

Link copied to clipboard
abstract val implementationName: String

Inheritors

Link copied to clipboard