CameraController

expect class CameraController : CameraControllerContract

A controller that manages the state and interactions of the camera.

This class serves as the primary interface for interacting with the underlying camera when bound to a com.ujizin.camposer.session.CameraSession.

It offers methods to capture images, record videos, and manipulate camera parameters such as zoom, exposure, focus, flash modes, and torch settings.

actual class CameraController : CommonCameraController<RecordController, TakePictureCommand>

Constructors

Link copied to clipboard
actual constructor()
expect constructor()
actual constructor()

Properties

info
Link copied to clipboard
open override val info: CameraInfo?
expect open override val info: CameraInfo?
open override val info: CameraInfo?
isMuted
Link copied to clipboard
open override val isMuted: StateFlow<Boolean>
expect open override val isMuted: StateFlow<Boolean>
open override val isMuted: StateFlow<Boolean>
isRecording
Link copied to clipboard
open override val isRecording: StateFlow<Boolean>
expect open override val isRecording: StateFlow<Boolean>
open override val isRecording: StateFlow<Boolean>
isRunning
Link copied to clipboard
open override val isRunning: StateFlow<Boolean>
expect open override val isRunning: StateFlow<Boolean>
open override val isRunning: StateFlow<Boolean>
state
Link copied to clipboard
open override val state: CameraState?
expect open override val state: CameraState?
open override val state: CameraState?

Functions

muteRecording
Link copied to clipboard
open override fun muteRecording(isMuted: Boolean): Result<Boolean>
expect open override fun muteRecording(isMuted: Boolean): Result<Boolean>
open override fun muteRecording(isMuted: Boolean): Result<Boolean>
pauseRecording
Link copied to clipboard
open override fun pauseRecording(): Result<Boolean>
expect open override fun pauseRecording(): Result<Boolean>
open override fun pauseRecording(): Result<Boolean>
resumeRecording
Link copied to clipboard
open override fun resumeRecording(): Result<Boolean>
expect open override fun resumeRecording(): Result<Boolean>
open override fun resumeRecording(): Result<Boolean>
setExposureCompensation
Link copied to clipboard
open override fun setExposureCompensation(exposureCompensation: Float)
expect open override fun setExposureCompensation(exposureCompensation: Float)
open override fun setExposureCompensation(exposureCompensation: Float)
setFlashMode
Link copied to clipboard
open override fun setFlashMode(flashMode: FlashMode): Result<Unit>
expect open override fun setFlashMode(flashMode: FlashMode): Result<Unit>
open override fun setFlashMode(flashMode: FlashMode): Result<Unit>
setMirrorMode
Link copied to clipboard
open override fun setMirrorMode(mirrorMode: MirrorMode)
expect open override fun setMirrorMode(mirrorMode: MirrorMode)
open override fun setMirrorMode(mirrorMode: MirrorMode)
setOrientationStrategy
Link copied to clipboard
open override fun setOrientationStrategy(strategy: OrientationStrategy)
expect open override fun setOrientationStrategy(strategy: OrientationStrategy)
open override fun setOrientationStrategy(strategy: OrientationStrategy)
setTorchEnabled
Link copied to clipboard
open override fun setTorchEnabled(isTorchEnabled: Boolean): Result<Unit>
expect open override fun setTorchEnabled(isTorchEnabled: Boolean): Result<Unit>
open override fun setTorchEnabled(isTorchEnabled: Boolean): Result<Unit>
setVideoFrameRate
Link copied to clipboard
open override fun setVideoFrameRate(frameRate: Int): Result<Unit>
expect open override fun setVideoFrameRate(frameRate: Int): Result<Unit>
open override fun setVideoFrameRate(frameRate: Int): Result<Unit>
setVideoStabilizationEnabled
Link copied to clipboard
open override fun setVideoStabilizationEnabled(mode: VideoStabilizationMode): Result<Unit>
setZoomRatio
Link copied to clipboard
open override fun setZoomRatio(zoomRatio: Float)
expect open override fun setZoomRatio(zoomRatio: Float)
open override fun setZoomRatio(zoomRatio: Float)
startRecording
Link copied to clipboard
@RequiresApi(value = <Unsupported Annotation Value>::class)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
open override fun startRecording(fileDescriptorOutputOptions: FileDescriptorOutputOptions, audioConfig: AudioConfig, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
open override fun startRecording(fileOutputOptions: FileOutputOptions, audioConfig: AudioConfig, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
open override fun startRecording(mediaStoreOutputOptions: MediaStoreOutputOptions, audioConfig: AudioConfig, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
open override fun startRecording(filename: String, onVideoCaptured: (CaptureResult<String>) -> Unit)

@RequiresApi(value = <Unsupported Annotation Value>::class)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
abstract fun startRecording(fileDescriptorOutputOptions: FileDescriptorOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true), onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
abstract fun startRecording(fileOutputOptions: FileOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true), onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
abstract fun startRecording(mediaStoreOutputOptions: MediaStoreOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true), onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)

Start recording camera.

expect open override fun startRecording(filename: String, onVideoCaptured: (CaptureResult<String>) -> Unit)
open override fun startRecording(filename: String, onVideoCaptured: (CaptureResult<String>) -> Unit)
stopRecording
Link copied to clipboard
open override fun stopRecording(): Result<Boolean>
expect open override fun stopRecording(): Result<Boolean>
open override fun stopRecording(): Result<Boolean>
takePicture
Link copied to clipboard
open override fun takePicture(outputFileOptions: ImageCapture.OutputFileOptions, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
open override fun takePicture(file: File, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
open override fun takePicture(contentValues: ERROR CLASS: Symbol not found for ContentValues, saveCollection: ERROR CLASS: Symbol not found for Uri, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
open override fun takePicture(onImageCaptured: (CaptureResult<ByteArray>) -> Unit)
open override fun takePicture(filename: String, onImageCaptured: (CaptureResult<String>) -> Unit)

abstract fun takePicture(outputFileOptions: ImageCapture.OutputFileOptions, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
abstract fun takePicture(file: File, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
abstract fun takePicture(contentValues: ERROR CLASS: Symbol not found for ContentValues, saveCollection: ERROR CLASS: Symbol not found for Uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI, onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)

Take a picture with the camera.

expect open override fun takePicture(onImageCaptured: (CaptureResult<ByteArray>) -> Unit)
expect open override fun takePicture(filename: String, onImageCaptured: (CaptureResult<String>) -> Unit)
open override fun takePicture(onImageCaptured: (CaptureResult<ByteArray>) -> Unit)
open override fun takePicture(filename: String, onImageCaptured: (CaptureResult<String>) -> Unit)
Link copied to clipboard
suspend fun CameraController.takePicture(outputFileOptions: ImageCapture.OutputFileOptions): ERROR CLASS: Symbol not found for Uri??

Transform takePicture output files options to suspend function

suspend fun CameraController.takePicture(file: File): ERROR CLASS: Symbol not found for Uri??

Transform takePicture file to suspend function

suspend fun CameraController.takePicture(contentValues: ERROR CLASS: Symbol not found for ContentValues, saveCollection: ERROR CLASS: Symbol not found for Uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI): ERROR CLASS: Symbol not found for Uri??

Transform takePicture content values to suspend function

Link copied to clipboard
@RequiresApi(value = <Unsupported Annotation Value>::class)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
open fun toggleRecording(fileDescriptorOutputOptions: FileDescriptorOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true), onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
open fun toggleRecording(fileOutputOptions: FileOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true), onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
open fun toggleRecording(mediaStoreOutputOptions: MediaStoreOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true), onResult: (CaptureResult<ERROR CLASS: Symbol not found for Uri??>) -> Unit)

Toggle recording camera.

Link copied to clipboard
@RequiresApi(value = <Unsupported Annotation Value>::class)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
suspend fun CameraController.toggleRecording(fileDescriptorOutputOptions: FileDescriptorOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true)): ERROR CLASS: Symbol not found for Uri??

Transform toggle recording output files options to suspend function

@RequiresApi(value = <Unsupported Annotation Value>::class)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
suspend fun CameraController.toggleRecording(fileOutputOptions: FileOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true)): ERROR CLASS: Symbol not found for Uri??

Transform toggle recording file to suspend function

@RequiresApi(value = <Unsupported Annotation Value>::class)
@RequiresPermission(value = <Unsupported Annotation Value>::class)
suspend fun CameraController.toggleRecording(mediaStoreOutputOptions: MediaStoreOutputOptions, audioConfig: AudioConfig = AudioConfig.create(true)): ERROR CLASS: Symbol not found for Uri??

Transform toggle recording content values options to suspend function