1 /* Copyright (c) 2016, The Linux Foundation. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are
5  * met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above
9  *       copyright notice, this list of conditions and the following
10  *       disclaimer in the documentation and/or other materials provided
11  *       with the distribution.
12  *     * Neither the name of The Linux Foundation nor the names of its
13  *       contributors may be used to endorse or promote products derived
14  *       from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 
30 #ifndef __QCAMERADUALCAMSETTINGS_H__
31 #define __QCAMERADUALCAMSETTINGS_H__
32 
33 typedef enum {
34     NONE,
35     SENSOR_SLEEP,
36     ISPIF_FRAME_DROP
37 } dual_cam_low_power_mode;
38 
39 
40 // Dual camera settings
41 
42 // This setting should be 1 if hw sync is in place, 0 otherwise.
43 #define DUALCAM_HW_SYNC_ENABLED                 (1)
44 
45 // This setting enables/disables LPM. When disabled(0), none of the cameras will go
46 // into low power mode.
47 #define DUALCAM_LPM_ENABLE                      (1)
48 
49 // This setting indicates low power modes for two cameras. Possible low power modes are listed
50 // under dual_cam_low_power_mode.
51 #define DUALCAM_LPM_MAIN                   (ISPIF_FRAME_DROP)
52 #define DUALCAM_LPM_AUX                    (SENSOR_SLEEP)
53 
54 
55 // FOV-control settings
56 
57 // Main camera fallback mechanism for low light and macro scene
58 // If set to 1, low light and macro scene will force the transition from narrow FOV to
59 // wide FOV camera
60 // If set to 0, these conditions are ignored and the forced transition from narrow FOV to
61 // wide FOV camera will not take place
62 #define FOVC_MAIN_CAM_FALLBACK_MECHANISM        (1)
63 
64 // Use external zoom translator. Setting this to 1 allows opening an external lib containing
65 // implementation for custom zoom translation for user zoom to wide zoom and tele zoom. This
66 // would override the default zoom translation logic present in the FOV-control.
67 #define FOVC_USE_EXTERNAL_ZOOM_TRANSLATOR       (0)
68 
69 // camera mode settings
70 
71 // This setting will enable the snapshot postprocessing.
72 // If set to 1, it will enable capturing snapshots from both the cameras and feeding those
73 // to snapshot postprocessing algorithm.
74 // If set to 0, a snapshot is captured only from the master camera session at any time.
75 #define FOVC_CAM_SNAPSHOT_PP_ENABLE             (1)
76 
77 // This setting indicates the minimum zoom value for the snapshot postprocessing.
78 // Snapshot postprocessing is only enabled for zoom equal to and higher than this value.
79 #define FOVC_CAM_SNAPSHOT_PP_ZOOM_MIN           (1.5)
80 
81 // This setting indicates the maximum zoom value for the snapshot postprocessing.
82 // Snapshot postprocessing is only enabled for zoom equal to and lower than this value.
83 #define FOVC_CAM_SNAPSHOT_PP_ZOOM_MAX           (2.75)
84 
85 // This setting indicates the minimum lux value for snapshot postprocessing.
86 // If the current lux is lower than this value, snapshot postprocessing will be disabled
87 #define FOVC_CAM_SNAPSHOT_PP_LUX_MIN            (100)
88 
89 // camcorder mode settings
90 
91 // This setting will enable the snapshot postprocessing.
92 // If set to 1, it will enable capturing snapshots from both the cameras and feeding those
93 // to snapshot postprocessing algorithm.
94 // If set to 0, a snapshot is captured only from the master camera session at any time.
95 #define FOVC_CAMCORDER_SNAPSHOT_PP_ENABLE       (0)
96 
97 // Main and Aux camera switch settings
98 // These values indicates the lux amd min focus distance thresholds to switch the preview
99 // from main to aux camera. If the current lux or focus distance values are lower than
100 // these thresholds, camera preview will not switch from main to aux.
101 #define FOVC_AUXCAM_SWITCH_LUX_MIN              (100)
102 #define FOVC_AUXCAM_SWITCH_FOCUS_DIST_CM_MIN    (15)
103 
104 // This setting indicates the threshold for zoom stable count in terms of number of frames.
105 // This is a power optimization setting. When in the transition zone, if the zoom doesn't
106 // change for thse many frames, the non-master camera is put in LPM.
107 #define FOVC_ZOOM_STABLE_COUNT_THRESHOLD        (15)
108 
109 // This setting indicates the threshold for focus distance stable count in terms of number of frames
110 // This threshold is used for the macro scene focus and change the camera state accordingly.
111 #define FOVC_FOCUS_DIST_STABLE_COUNT_THRESHOLD  (15)
112 
113 // This setting indicates the threshold for brightness stable count in terms of number of frames.
114 // This threshold is used for the low light condition and change the camera state accordingly.
115 #define FOVC_BRIGHTNESS_STABLE_COUNT_THRESHOLD  (15)
116 
117 #endif /* __QCAMERADUALCAM_H__ */
118