CameraFactory

interface CameraFactory

The CameraFactory allows creating various other Camera related objects.

Use the VisionCamera instance:

if (VisionCamera.cameraPermissionStatus != PermissionStatus.AUTHORIZED) {
VisionCamera.requestCameraPermission()
}
val session = VisionCamera.createCameraSession(enableMultiCam = false)

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard

The current Microphone PermissionStatus.

Link copied to clipboard

Whether the platform supports creating multi-cam CameraSessions. Older phones may not support this.

Functions

Link copied to clipboard
abstract suspend fun createCameraSession(enableMultiCam: Boolean): CameraSession

Creates a new CameraSession.

Link copied to clipboard
abstract fun createDepthFrameOutput(options: DepthFrameOutputOptions = DepthFrameOutputOptions()): CameraDepthFrameOutput

Create a new CameraDepthFrameOutput with the given options, to stream Depth frames.

Link copied to clipboard

Create a new CameraDeviceFactory.

Link copied to clipboard
abstract fun createFrameOutput(options: FrameOutputOptions = FrameOutputOptions()): CameraFrameOutput

Create a new CameraFrameOutput with the given options, to stream Frames (Frame Processing).

Link copied to clipboard

Create a new FrameRenderer, to render Frames into a FrameRendererView.

Link copied to clipboard
abstract fun createNormalizedMeteringPoint(x: Double, y: Double, size: Double? = null): MeteringPoint

Create a MeteringPoint from normalized coordinates, from 0.0 to 1.0. You are responsible for handling orientation, cropping and scaling; to create a point from a tap on a PreviewView, use its createMeteringPoint instead.

Link copied to clipboard

Create a new CameraObjectOutput with the given options, to scan codes, faces and bodies.

Link copied to clipboard

Create a new OrientationManager tracking the given orientationSource.

Link copied to clipboard

Create a new CameraOutputSynchronizer synchronizing the given outputs.

Link copied to clipboard
abstract fun createPhotoOutput(options: PhotoOutputOptions = PhotoOutputOptions()): CameraPhotoOutput

Create a new CameraPhotoOutput with the given options.

Link copied to clipboard
Link copied to clipboard

Create a new TapToFocusGestureController, to attach to a PreviewView.

Link copied to clipboard
abstract fun createVideoOutput(options: VideoOutputOptions = VideoOutputOptions()): CameraVideoOutput

Create a new CameraVideoOutput with the given options.

Link copied to clipboard

Create a new ZoomGestureController, to attach to a PreviewView.

Link copied to clipboard
abstract suspend fun requestCameraPermission(): Boolean

Request Camera permission.

Link copied to clipboard
abstract suspend fun requestMicrophonePermission(): Boolean

Request Microphone permission.

Link copied to clipboard
abstract suspend fun resolveConstraints(device: CameraDevice, outputConfigurations: List<CameraOutputConfiguration>, constraints: List<Constraint>, requiresMultiCam: Boolean = false): CameraSessionConfig

Resolves the given constraints to a fully validated CameraSessionConfig respecting the given device's capabilities negotiated with the given outputConfigurations.