diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2015-04-07 13:47:46 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2015-04-15 17:26:13 -0700 |
commit | aee4782839de3103ecebca830a6bd49263a37ad3 (patch) | |
tree | 42e82a6e64c73cd35ebb93bbc06626cdd180c2b1 /include/hardware | |
parent | 33642b9c5763a3ad7cebbe8918a6a8d31f3a63a5 (diff) | |
download | hardware_libhardware-aee4782839de3103ecebca830a6bd49263a37ad3.zip hardware_libhardware-aee4782839de3103ecebca830a6bd49263a37ad3.tar.gz hardware_libhardware-aee4782839de3103ecebca830a6bd49263a37ad3.tar.bz2 |
Camera: Add HAL module init method.
For use by Camera HAL libraries to perform one-time initialization
steps after the library is loaded.
Bug: 20016050
Change-Id: Ia01ae0eafcadece9124ac2cfcc3b1c3939352843
Diffstat (limited to 'include/hardware')
-rw-r--r-- | include/hardware/camera_common.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h index c2d4536..fe3b7d7 100644 --- a/include/hardware/camera_common.h +++ b/include/hardware/camera_common.h @@ -113,6 +113,10 @@ __BEGIN_DECLS * To specify valid combinations of devices, the resource_cost and conflicting_devices * fields should always be set in the camera_info structure returned by the * get_camera_info call. + * + * 4. Module initialization method. This will be called by the camera service + * right after the HAL module is loaded, to allow for one-time initialization + * of the HAL. It is called before any other module methods are invoked. */ /** @@ -868,8 +872,39 @@ typedef struct camera_module { */ int (*set_torch_mode)(const char* camera_id, bool enabled); + /** + * init: + * + * This method is called by the camera service before any other methods + * are invoked, right after the camera HAL library has been successfully + * loaded. It may be left as NULL by the HAL module, if no initialization + * in needed. + * + * It can be used by HAL implementations to perform initialization and + * other one-time operations. + * + * 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: + * Not provided by HAL module. Framework will not call this function. + * + * CAMERA_MODULE_API_VERSION_2_4: + * If not NULL, will always be called by the framework once after the HAL + * module is loaded, before any other HAL module method is called. + * + * Return values: + * + * 0: On a successful operation. + * + * -ENODEV: Initialization cannot be completed due to an internal + * error. The HAL must be assumed to be in a nonfunctional + * state. + * + */ + int (*init)(); + /* reserved for future use */ - void* reserved[6]; + void* reserved[5]; } camera_module_t; __END_DECLS |