Android Hardware Abstraction Layer
Data Structures | Macros | Typedefs | Enumerations
camera_common.h File Reference
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <cutils/native_handle.h>
#include <system/camera.h>
#include <hardware/hardware.h>
#include <hardware/gralloc.h>

Go to the source code of this file.

Data Structures

struct  camera_info
 
struct  camera_module_callbacks
 
struct  vendor_tag_ops
 
struct  camera_module
 

Macros

#define CAMERA_HARDWARE_MODULE_ID   "camera"
 
#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_2_1   HARDWARE_MODULE_API_VERSION(2, 1)
 
#define CAMERA_MODULE_API_VERSION_2_2   HARDWARE_MODULE_API_VERSION(2, 2)
 
#define CAMERA_MODULE_API_VERSION_CURRENT   CAMERA_MODULE_API_VERSION_2_2
 
#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_DEVICE_API_VERSION_2_1   HARDWARE_DEVICE_API_VERSION(2, 1)
 
#define CAMERA_DEVICE_API_VERSION_3_0   HARDWARE_DEVICE_API_VERSION(3, 0)
 
#define CAMERA_DEVICE_API_VERSION_3_1   HARDWARE_DEVICE_API_VERSION(3, 1)
 
#define CAMERA_DEVICE_API_VERSION_CURRENT   CAMERA_DEVICE_API_VERSION_1_0
 

Typedefs

typedef struct camera_metadata camera_metadata_t
 
typedef struct camera_info camera_info_t
 
typedef enum camera_device_status camera_device_status_t
 
typedef struct
camera_module_callbacks 
camera_module_callbacks_t
 
typedef struct vendor_tag_ops vendor_tag_ops_t
 
typedef struct camera_module camera_module_t
 

Enumerations

enum  camera_device_status { CAMERA_DEVICE_STATUS_NOT_PRESENT = 0, CAMERA_DEVICE_STATUS_PRESENT = 1, CAMERA_DEVICE_STATUS_ENUMERATING = 2 }
 

Macro Definition Documentation

#define CAMERA_DEVICE_API_VERSION_1_0   HARDWARE_DEVICE_API_VERSION(1, 0)

All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated as CAMERA_DEVICE_API_VERSION_1_0

Definition at line 98 of file camera_common.h.

#define CAMERA_DEVICE_API_VERSION_2_0   HARDWARE_DEVICE_API_VERSION(2, 0)

Definition at line 99 of file camera_common.h.

#define CAMERA_DEVICE_API_VERSION_2_1   HARDWARE_DEVICE_API_VERSION(2, 1)

Definition at line 100 of file camera_common.h.

#define CAMERA_DEVICE_API_VERSION_3_0   HARDWARE_DEVICE_API_VERSION(3, 0)

Definition at line 101 of file camera_common.h.

#define CAMERA_DEVICE_API_VERSION_3_1   HARDWARE_DEVICE_API_VERSION(3, 1)

Definition at line 102 of file camera_common.h.

#define CAMERA_DEVICE_API_VERSION_CURRENT   CAMERA_DEVICE_API_VERSION_1_0

Definition at line 105 of file camera_common.h.

#define CAMERA_HARDWARE_MODULE_ID   "camera"

The id of this module

Definition at line 35 of file camera_common.h.

#define CAMERA_MODULE_API_VERSION_1_0   HARDWARE_MODULE_API_VERSION(1, 0)

Module versioning information for the Camera hardware module, based on camera_module_t.common.module_api_version. The two most significant hex digits represent the major version, and the two least significant represent the minor version.

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 module support only version 1 of the camera device HAL. The device_version and static_camera_characteristics fields of camera_info are not valid. Only the android.hardware.Camera API can be supported by this module and its devices.

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 module may support either version 1.0 or version 2.0 of the camera device HAL interface. The device_version field of camera_info is always valid; the static_camera_characteristics field of camera_info is valid if the device_version field is 2.0 or higher.

Version: 2.1 [CAMERA_MODULE_API_VERSION_2_1]

This camera module version adds support for asynchronous callbacks to the framework from the camera HAL module, which is used to notify the framework about changes to the camera module state. Modules that provide a valid set_callbacks() method must report at least this version number.

Version: 2.2 [CAMERA_MODULE_API_VERSION_2_2]

This camera module version adds vendor tag support from the module, and deprecates the old vendor_tag_query_ops that were previously only accessible with a device open. 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

Definition at line 87 of file camera_common.h.

#define CAMERA_MODULE_API_VERSION_2_0   HARDWARE_MODULE_API_VERSION(2, 0)

Definition at line 88 of file camera_common.h.

#define CAMERA_MODULE_API_VERSION_2_1   HARDWARE_MODULE_API_VERSION(2, 1)

Definition at line 89 of file camera_common.h.

#define CAMERA_MODULE_API_VERSION_2_2   HARDWARE_MODULE_API_VERSION(2, 2)

Definition at line 90 of file camera_common.h.

#define CAMERA_MODULE_API_VERSION_CURRENT   CAMERA_MODULE_API_VERSION_2_2

Definition at line 92 of file camera_common.h.

Typedef Documentation

camera_device_status_t:

The current status of the camera device, as provided by the HAL through the camera_module_callbacks.camera_device_status_change() call.

At module load time, the framework will assume all camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke camera_module_callbacks::camera_device_status_change to inform the framework of any initially NOT_PRESENT devices.

Allowed transitions: PRESENT -> NOT_PRESENT NOT_PRESENT -> ENUMERATING NOT_PRESENT -> PRESENT ENUMERATING -> PRESENT ENUMERATING -> NOT_PRESENT

typedef struct camera_info camera_info_t
typedef struct camera_metadata camera_metadata_t

Defined in /system/media/camera/include/system/camera_metadata.h

Definition at line 110 of file camera_common.h.

Callback functions for the camera HAL module to use to inform the framework of changes to the camera subsystem. These are called only by HAL modules implementing version CAMERA_MODULE_API_VERSION_2_1 or higher of the HAL module API interface.

Set up vendor-specific tag query methods. These are needed to properly query entries with vendor-specified tags, potentially returned by get_camera_info.

This should be used in place of vendor_tag_query_ops, which are deprecated.

Definition at line 260 of file camera_common.h.

Enumeration Type Documentation

camera_device_status_t:

The current status of the camera device, as provided by the HAL through the camera_module_callbacks.camera_device_status_change() call.

At module load time, the framework will assume all camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke camera_module_callbacks::camera_device_status_change to inform the framework of any initially NOT_PRESENT devices.

Allowed transitions: PRESENT -> NOT_PRESENT NOT_PRESENT -> ENUMERATING NOT_PRESENT -> PRESENT ENUMERATING -> PRESENT ENUMERATING -> NOT_PRESENT

Enumerator
CAMERA_DEVICE_STATUS_NOT_PRESENT 

The camera device is not currently connected, and opening it will return failure. Calls to get_camera_info must still succeed, and provide the same information it would if the camera were connected

CAMERA_DEVICE_STATUS_PRESENT 

The camera device is connected, and opening it will succeed. The information returned by get_camera_info cannot change due to this status change. By default, the framework will assume all devices are in this state.

CAMERA_DEVICE_STATUS_ENUMERATING 

The camera device is connected, but it is undergoing an enumeration and so opening the device will return -EBUSY. Calls to get_camera_info must still succeed, as if the camera was in the PRESENT status.

Definition at line 197 of file camera_common.h.