summaryrefslogtreecommitdiffstats
path: root/include/hardware/camera_common.h
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2015-02-03 18:27:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-03 18:27:54 +0000
commita40a7cebcdd7495f6dae06755e5a4da3a4446dc4 (patch)
tree9c3fc52280c17a2036cddac9b861842f3f7af1dc /include/hardware/camera_common.h
parent901349a66b3778badf1355662d8de0fecc149ba5 (diff)
parent46edf1ac4735f5cb0a0a7e420e1341783003c689 (diff)
downloadhardware_libhardware-a40a7cebcdd7495f6dae06755e5a4da3a4446dc4.zip
hardware_libhardware-a40a7cebcdd7495f6dae06755e5a4da3a4446dc4.tar.gz
hardware_libhardware-a40a7cebcdd7495f6dae06755e5a4da3a4446dc4.tar.bz2
Merge "camera_common: add TORCH_MODE_STATUS_OFF"
Diffstat (limited to 'include/hardware/camera_common.h')
-rw-r--r--include/hardware/camera_common.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h
index f315bfb..7d5dce5 100644
--- a/include/hardware/camera_common.h
+++ b/include/hardware/camera_common.h
@@ -427,7 +427,10 @@ typedef enum camera_device_status {
* up by this close() call.
*
* Note that the framework calling set_torch_mode() should not trigger any
- * callbacks.
+ * callbacks except when HAL cannot keep multiple torch modes on
+ * simultaneously. In that case, HAL must notify the framework that any
+ * previously-on torch mode states have become TORCH_MODE_STATUS_OFF.
+ *
*/
typedef enum torch_mode_status {
/**
@@ -446,6 +449,15 @@ typedef enum torch_mode_status {
*/
TORCH_MODE_STATUS_RESOURCE_BUSY = 1,
+ /**
+ * The previously-on torch mode has been turned off by HAL but the flash
+ * unit is still available for set_torch_mode(). This may happen after the
+ * framework turned on the torch mode of some other camera device and HAL
+ * had to turn off the torch modes of any camera devices that were
+ * previously on.
+ */
+ TORCH_MODE_STATUS_OFF = 2,
+
} torch_mode_status_t;
/**
@@ -714,6 +726,12 @@ typedef struct camera_module {
* camera_module_callbacks.torch_mode_status_change() that the torch mode
* state has become available for set_torch_mode() to be called.
*
+ * When the framework calls set_torch_mode() to turn on the torch mode of a
+ * flash unit, if HAL cannot keep multiple torch modes on simultaneously,
+ * HAL should turn off the torch mode that was turned on by
+ * a previous set_torch_mode() call and notify the framework that the torch
+ * mode state of that flash unit has become TORCH_MODE_STATUS_OFF.
+ *
* Version information (based on camera_module_t.common.module_api_version):
*
* CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3:
@@ -738,7 +756,7 @@ typedef struct camera_module {
* -EINVAL: camera_id is invalid.
*
*/
- int (*set_torch_mode)(const char* camera_id, bool on);
+ int (*set_torch_mode)(const char* camera_id, bool enabled);
/* reserved for future use */
void* reserved[6];