CameraSession

actual class CameraSession

A state object that can be hoisted to control camera, take picture or record video.

To be created use rememberCameraSession.

expect class CameraSession

A session class that holds the current state and information of the camera.

This class serves as a "bridge" to access camera properties such as its current configuration state (CameraState) and hardware information (CameraInfo). It also provides flags indicating the runtime status of the camera, such as whether it is currently streaming or initialized.

actual class CameraSession

A session class that holds the current state and information of the camera.

This class serves as a "bridge" to access camera properties such as its current configuration state (CameraState) and hardware information (CameraInfo). It also provides flags indicating the runtime status of the camera, such as whether it is currently streaming or initialized.

Constructors

Link copied to clipboard
constructor(context: Context, lifecycleOwner: LifecycleOwner, cameraController: CameraController)
constructor(controller: CameraController, iosCameraSession: IOSCameraController = DefaultIOSCameraController( captureSession = AVCaptureSession(), previewManager = PreviewManager(), ))

Properties

Link copied to clipboard

The current controller bind to the camera.

The current controller bind to the camera.

The current controller bind to the camera.

Link copied to clipboard

Check if camera initialization failed. This can be used to show error UI or retry initialization.

Check if camera initialization failed. This can be used to show error UI or retry initialization.

Check if camera initialization failed. This can be used to show error UI or retry initialization.

Link copied to clipboard
actual val info: CameraInfo

The current info of the current camera.

expect val info: CameraInfo

The current info of the current camera.

actual val info: CameraInfo

The current info of the current camera.

Link copied to clipboard

Check if camera state is initialized or not.

Check if camera state is initialized or not.

Check if camera state is initialized or not.

Link copied to clipboard
actual var isStreaming: Boolean

Check if camera is streaming or not.

expect var isStreaming: Boolean

Check if camera is streaming or not.

actual var isStreaming: Boolean

Check if camera is streaming or not.

Link copied to clipboard
Link copied to clipboard
actual val state: CameraState

The current state of the current camera.

expect val state: CameraState

The current state of the current camera.

actual val state: CameraState

The current state of the current camera.

Functions

Link copied to clipboard
fun CameraSession.rememberImageAnalyzer(imageAnalysisBackpressureStrategy: ImageAnalysisBackpressureStrategy = KeepOnlyLatest, imageAnalysisResolutionSelector: ResolutionSelector? = cameraXController .imageAnalysisResolutionSelector, imageAnalysisImageQueueDepth: Int = cameraXController.imageAnalysisImageQueueDepth, analyze: ImageAnalysis.Analyzer): ImageAnalyzer

Create instance remember of ImageAnalyzer.

Link copied to clipboard
actual fun retryInitialization()

Retry camera initialization after a failure. This method resets the error state and attempts to initialize the camera again.

expect fun retryInitialization()

Retry camera initialization after a failure. This method resets the error state and attempts to initialize the camera again.

actual fun retryInitialization()

Retry camera initialization after a failure. This method resets the error state and attempts to initialize the camera again.