diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-03-27 16:50:18 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-27 16:50:18 -0700 |
commit | e911e4c160a2569efeb4a83bb3a73daa49bc927a (patch) | |
tree | e277c95efe12a0e785bd3fae8b4ddd5cd5212458 /include/hardware | |
parent | 89c8a6df0eb70d30b83576741d8fdf23ba652b1d (diff) | |
parent | ddc026e39344169f64f4696174a4d1269d069557 (diff) | |
download | hardware_libhardware-e911e4c160a2569efeb4a83bb3a73daa49bc927a.zip hardware_libhardware-e911e4c160a2569efeb4a83bb3a73daa49bc927a.tar.gz hardware_libhardware-e911e4c160a2569efeb4a83bb3a73daa49bc927a.tar.bz2 |
Merge "Add specific version number constants to Camera HAL."
Diffstat (limited to 'include/hardware')
-rw-r--r-- | include/hardware/camera.h | 8 | ||||
-rw-r--r-- | include/hardware/camera2.h | 6 | ||||
-rw-r--r-- | include/hardware/camera_common.h | 42 |
3 files changed, 38 insertions, 18 deletions
diff --git a/include/hardware/camera.h b/include/hardware/camera.h index 3530f8d..b7182f8 100644 --- a/include/hardware/camera.h +++ b/include/hardware/camera.h @@ -20,13 +20,14 @@ #include "camera_common.h" /** - * Camera device HAL, initial version [ HARDWARE_DEVICE_API_VERSION(1,0) ] + * Camera device HAL, initial version [ CAMERA_DEVICE_API_VERSION_1_0 ] * * Supports the android.hardware.Camera API. * * Camera devices that support this version of the HAL must return a value in * the range HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF) in - * camera_device_t.common.version. + * camera_device_t.common.version. CAMERA_DEVICE_API_VERSION_1_0 is the + * recommended value. * * Camera modules that implement version 2.0 or higher of camera_module_t must * also return the value of camera_device_t.common.version in @@ -281,7 +282,8 @@ typedef struct camera_device_ops { typedef struct camera_device { /** * camera_device.common.version must be in the range - * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). (1,0) is recommended. + * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). CAMERA_DEVICE_API_VERSION_1_0 is + * recommended. */ hw_device_t common; camera_device_ops_t *ops; diff --git a/include/hardware/camera2.h b/include/hardware/camera2.h index f94c56c..48f5c35 100644 --- a/include/hardware/camera2.h +++ b/include/hardware/camera2.h @@ -20,7 +20,7 @@ #include "camera_common.h" /** - * Camera device HAL 2.0 [ HARDWARE_DEVICE_API_VERSION(2,0) ] + * Camera device HAL 2.0 [ CAMERA_DEVICE_API_VERSION_2_0 ] * * EXPERIMENTAL. * @@ -28,7 +28,7 @@ * android.hardware.Camera APIs. * * Camera devices that support this version of the HAL must return - * CAMERA_DEVICE_API_VERSION(2, 0) in camera_device_t.common.version and in + * CAMERA_DEVICE_API_VERSION_2_0 in camera_device_t.common.version and in * camera_info_t.device_version (from camera_module_t.get_camera_info). * * Camera modules that may contain version 2.0 devices must implement at least @@ -265,7 +265,7 @@ typedef struct camera2_device_ops { typedef struct camera2_device { /** - * common.version must equal HARDWARE_DEVICE_API_VERSION(2, 0) to identify + * common.version must equal CAMERA_DEVICE_API_VERSION_2_0 to identify * this device as implementing version 2.0 of the camera device HAL. */ hw_device_t common; diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h index 2b6cd98..5459b6c 100644 --- a/include/hardware/camera_common.h +++ b/include/hardware/camera_common.h @@ -41,7 +41,7 @@ __BEGIN_DECLS * the minor version. * ******************************************************************************* - * Versions: 0.X-1.X + * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0] * * Camera modules that report these version numbers implement the initial * camera module HAL interface. All camera devices openable through this @@ -51,7 +51,7 @@ __BEGIN_DECLS * devices. * ******************************************************************************* - * Version: 2.0 + * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0] * * Camera modules that report this version number implement the second version * of the camera module HAL interface. Camera devices openable through this @@ -61,10 +61,28 @@ __BEGIN_DECLS * device_version field is 2.0 or higher. */ +/** + * Predefined macros for currently-defined version numbers + */ + +/** + * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated + * as CAMERA_MODULE_API_VERSION_1_0 + */ +#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) +#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) + +#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_0 + +/** + * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated + * as CAMERA_DEVICE_API_VERSION_1_0 + */ +#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) -#define CAMERA_MODULE_API_VERSION HARDWARE_MODULE_API_VERSION(2, 0) -// Stable version for device, version 2.0 is experimental -#define CAMERA_DEVICE_API_VERSION HARDWARE_DEVICE_API_VERSION(1, 0) +// Device version 2.0 is experimental +#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_1_0 /** * Defined in /system/media/camera/include/system/camera_metadata.h @@ -103,12 +121,12 @@ struct camera_info { * * Version information (based on camera_module_t.common.module_api_version): * - * HARDWARE_MODULE_API_VERSION(0, 0)-(1, FF): + * CAMERA_MODULE_API_VERSION_1_0: * - * Not valid. Can be assumed to be HARDWARE_DEVICE_API_VERSION(1,0). Do + * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do * not read this field. * - * HARDWARE_MODULE_API_VERSION(2, 0): + * CAMERA_MODULE_API_VERSION_2_0: * * Always valid * @@ -121,15 +139,15 @@ struct camera_info { * * Version information (based on camera_module_t.common.module_api_version): * - * HARDWARE_MODULE_API_VERSION(0, 0)-(1, FF): + * CAMERA_MODULE_API_VERSION_1_0: * * Not valid. Extra characteristics are not available. Do not read this * field. * - * HARDWARE_MODULE_API_VERSION(2, 0): + * CAMERA_MODULE_API_VERSION_2_0: * - * Valid if device_version >= HARDWARE_DEVICE_API_VERSION(2,0). Do not - * read otherwise. + * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read + * otherwise. * */ camera_metadata_t *static_camera_characteristics; |