summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2014-07-24 16:44:56 -0700
committerEino-Ville Talvala <etalvala@google.com>2014-07-24 17:04:45 -0700
commitc984be747d009fcd5376c9c629c6fc897ba1f76f (patch)
tree3e88e321c014f33f7492ba0fd31881a0b90db73f /include
parent941c928d9d19e3bd9bdd253923fb909dbb08a72e (diff)
downloadhardware_libhardware-c984be747d009fcd5376c9c629c6fc897ba1f76f.zip
hardware_libhardware-c984be747d009fcd5376c9c629c6fc897ba1f76f.tar.gz
hardware_libhardware-c984be747d009fcd5376c9c629c6fc897ba1f76f.tar.bz2
Camera: Define error codes for remaining camera_module methods.
Not previously documented, though already assumed to be this. Bug: 16514157 Change-Id: I9334fdf672c9772014681a5c346a6f20b51d8213
Diffstat (limited to 'include')
-rw-r--r--include/hardware/camera_common.h43
1 files changed, 41 insertions, 2 deletions
diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h
index 0ee929e..322ed93 100644
--- a/include/hardware/camera_common.h
+++ b/include/hardware/camera_common.h
@@ -268,8 +268,29 @@ typedef struct camera_module {
/**
* Common methods of the camera module. This *must* be the first member of
* camera_module as users of this structure will cast a hw_module_t to
- * camera_module pointer in contexts where it's known the hw_module_t references a
- * camera_module.
+ * camera_module pointer in contexts where it's known the hw_module_t
+ * references a camera_module.
+ *
+ * The return values for common.methods->open for camera_module are:
+ *
+ * 0: On a successful open of the camera device.
+ *
+ * -ENODEV: The camera device cannot be opened due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
+ * and/or the module is invalid.
+ *
+ * -EBUSY: The camera device was already opened for this camera id
+ * (by using this method or open_legacy),
+ * regardless of the device HAL version it was opened as.
+ *
+ * -EUSERS: The maximal number of camera devices that can be
+ * opened concurrently were opened already, either by
+ * this method or the open_legacy method.
+ *
+ * All other return values from common.methods->open will be treated as
+ * -ENODEV.
*/
hw_module_t common;
@@ -293,6 +314,15 @@ typedef struct camera_module {
* Return the static camera information for a given camera device. This
* information may not change for a camera device.
*
+ * Return values:
+ *
+ * 0: On a successful operation
+ *
+ * -ENODEV: The information cannot be provided due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
+ * and/or the module is invalid.
*/
int (*get_camera_info)(int camera_id, struct camera_info *info);
@@ -315,6 +345,15 @@ typedef struct camera_module {
*
* Valid to be called by the framework.
*
+ * Return values:
+ *
+ * 0: On a successful operation
+ *
+ * -ENODEV: The operation cannot be completed due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the callbacks are
+ * null
*/
int (*set_callbacks)(const camera_module_callbacks_t *callbacks);