From b6e34dd9f459395aeb384bb22fe7254b47788b9e Mon Sep 17 00:00:00 2001 From: ThibaultBee <37510686+ThibaultBee@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:11:23 +0100 Subject: [PATCH] feat(core): camera: add a setting to lock auto exposure --- .../sources/video/camera/CameraSettings.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/io/github/thibaultbee/streampack/core/elements/sources/video/camera/CameraSettings.kt b/core/src/main/java/io/github/thibaultbee/streampack/core/elements/sources/video/camera/CameraSettings.kt index 2672f0da..1c5f9278 100644 --- a/core/src/main/java/io/github/thibaultbee/streampack/core/elements/sources/video/camera/CameraSettings.kt +++ b/core/src/main/java/io/github/thibaultbee/streampack/core/elements/sources/video/camera/CameraSettings.kt @@ -215,7 +215,7 @@ class WhiteBalance(private val context: Context, private val cameraController: C } /** - * Get or set auto white balance lock. + * Gets or sets auto white balance lock. */ var lock: Boolean get() = cameraController.getSetting(CaptureRequest.CONTROL_AWB_LOCK) ?: false @@ -377,6 +377,18 @@ class Exposure(private val context: Context, private val cameraController: Camer ) } + /** + * Gets or sets auto exposure lock. + */ + var lock: Boolean + get() = cameraController.getSetting(CaptureRequest.CONTROL_AE_LOCK) ?: false + set(value) { + cameraController.setRepeatingSetting( + CaptureRequest.CONTROL_AE_LOCK, + value + ) + } + companion object { const val DEFAULT_COMPENSATION = 0 val DEFAULT_COMPENSATION_RANGE = Range(DEFAULT_COMPENSATION, DEFAULT_COMPENSATION)