Revert "Revert "QCamera3: Flash Firing Level Support""
This reverts commit 2c0ec473291d45f54a48e48d2f7471630119f08d.
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 5f22829..fda8a70 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -2008,6 +2008,14 @@
avail_awb_modes,
size);
+ uint8_t available_flash_levels[CAM_FLASH_FIRING_LEVEL_MAX];
+ for (int i = 0; i < gCamCapability[cameraId]->supported_flash_firing_level_cnt; i++)
+ available_flash_levels[i] = gCamCapability[cameraId]->supported_firing_levels[i];
+
+ staticInfo.update(ANDROID_FLASH_FIRING_POWER,
+ available_flash_levels,
+ gCamCapability[cameraId]->supported_flash_firing_level_cnt);
+
uint8_t avail_flash_modes[CAM_FLASH_MODE_MAX];
size = 0;
for (int i = 0; i < gCamCapability[cameraId]->supported_flash_modes_cnt; i++) {
@@ -2481,6 +2489,9 @@
static const uint8_t flashMode = ANDROID_FLASH_MODE_OFF;
settings.update(ANDROID_FLASH_MODE, &flashMode, 1);
+ static const uint8_t flashFiringLevel = CAM_FLASH_FIRING_LEVEL_4;
+ settings.update(ANDROID_FLASH_FIRING_POWER,
+ &flashFiringLevel, 1);
/* lens */
float default_aperture = gCamCapability[mCameraId]->apertures[0];
diff --git a/camera/QCamera2/stack/common/cam_intf.h b/camera/QCamera2/stack/common/cam_intf.h
index 3044360..0e1bf53 100644
--- a/camera/QCamera2/stack/common/cam_intf.h
+++ b/camera/QCamera2/stack/common/cam_intf.h
@@ -231,6 +231,19 @@
/* Time taken before flash can fire again in nano secs */
int64_t flash_charge_duration;
+ /* flash firing power */
+ uint8_t supported_flash_firing_level_cnt;
+ cam_format_t supported_firing_levels[CAM_FLASH_FIRING_LEVEL_MAX];
+
+ /* Flash Firing Time */
+ int64_t flash_firing_time;
+
+ /* Flash Ciolor Temperature */
+ uint8_t flash_color_temp;
+
+ /* Flash max Energy */
+ uint8_t flash_max_energy;
+
/* Maximum number of supported points in the tonemap
curve */
int32_t max_tone_map_curve_points;
diff --git a/camera/QCamera2/stack/common/cam_types.h b/camera/QCamera2/stack/common/cam_types.h
index d41aa03..29c6ddc 100644
--- a/camera/QCamera2/stack/common/cam_types.h
+++ b/camera/QCamera2/stack/common/cam_types.h
@@ -461,6 +461,22 @@
} cam_flash_mode_t;
typedef enum {
+ CAM_FLASH_FIRING_LEVEL_0,
+ CAM_FLASH_FIRING_LEVEL_1,
+ CAM_FLASH_FIRING_LEVEL_2,
+ CAM_FLASH_FIRING_LEVEL_3,
+ CAM_FLASH_FIRING_LEVEL_4,
+ CAM_FLASH_FIRING_LEVEL_5,
+ CAM_FLASH_FIRING_LEVEL_6,
+ CAM_FLASH_FIRING_LEVEL_7,
+ CAM_FLASH_FIRING_LEVEL_8,
+ CAM_FLASH_FIRING_LEVEL_9,
+ CAM_FLASH_FIRING_LEVEL_10,
+ CAM_FLASH_FIRING_LEVEL_MAX
+} cam_flash_firing_level_t;
+
+
+typedef enum {
CAM_AEC_TRIGGER_IDLE,
CAM_AEC_TRIGGER_START
} cam_aec_trigger_type_t;