• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.google.jetpackcamera.settings.model
17 
18 const val TARGET_FPS_AUTO = 0
19 const val UNLIMITED_VIDEO_DURATION = 0L
20 val DEFAULT_HDR_DYNAMIC_RANGE = DynamicRange.HLG10
21 val DEFAULT_HDR_IMAGE_OUTPUT = ImageOutputFormat.JPEG_ULTRA_HDR
22 
23 /**
24  * Data layer representation for settings.
25  */
26 data class CameraAppSettings(
27     val captureMode: CaptureMode = CaptureMode.STANDARD,
28     val cameraLensFacing: LensFacing = LensFacing.BACK,
29     val darkMode: DarkMode = DarkMode.SYSTEM,
30     val flashMode: FlashMode = FlashMode.OFF,
31     val streamConfig: StreamConfig = StreamConfig.MULTI_STREAM,
32     val aspectRatio: AspectRatio = AspectRatio.NINE_SIXTEEN,
33     val stabilizationMode: StabilizationMode = StabilizationMode.AUTO,
34     val dynamicRange: DynamicRange = DynamicRange.SDR,
35     val videoQuality: VideoQuality = VideoQuality.UNSPECIFIED,
36     val zoomScale: Float = 1f,
37     val targetFrameRate: Int = TARGET_FPS_AUTO,
38     val imageFormat: ImageOutputFormat = ImageOutputFormat.JPEG,
39     val audioEnabled: Boolean = true,
40     val deviceRotation: DeviceRotation = DeviceRotation.Natural,
41     val concurrentCameraMode: ConcurrentCameraMode = ConcurrentCameraMode.OFF,
42     val maxVideoDurationMillis: Long = UNLIMITED_VIDEO_DURATION
43 )
44 
SystemConstraintsnull45 fun SystemConstraints.forCurrentLens(cameraAppSettings: CameraAppSettings): CameraConstraints? =
46     perLensConstraints[cameraAppSettings.cameraLensFacing]
47 
48 val DEFAULT_CAMERA_APP_SETTINGS = CameraAppSettings()
49