camera_module Struct Reference

#include <camera_common.h>

Data Fields

hw_module_t common
 
int(* get_number_of_cameras )(void)
 
int(* get_camera_info )(int camera_id, struct camera_info *info)
 
int(* set_callbacks )(const camera_module_callbacks_t *callbacks)
 
void(* get_vendor_tag_ops )(vendor_tag_ops_t *ops)
 
int(* open_legacy )(const struct hw_module_t *module, const char *id, uint32_t halVersion, struct hw_device_t **device)
 
void * reserved [7]
 

Detailed Description

Definition at line 268 of file camera_common.h.

Field Documentation

hw_module_t common

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.

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.

Definition at line 296 of file camera_common.h.

int(* get_camera_info)(int camera_id, struct camera_info *info)

get_camera_info:

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.

Definition at line 328 of file camera_common.h.

int(* get_number_of_cameras)(void)

get_number_of_cameras:

Returns the number of camera devices accessible through the camera module. The camera devices are numbered 0 through N-1, where N is the value returned by this call. The name of the camera device for open() is simply the number converted to a string. That is, "0" for camera ID 0, "1" for camera ID 1.

The value here must be static, and cannot change after the first call to this method

Definition at line 310 of file camera_common.h.

void(* get_vendor_tag_ops)(vendor_tag_ops_t *ops)

get_vendor_tag_ops:

Get methods to query for vendor extension metadata tag information. The HAL should fill in all the vendor tag operation methods, or leave ops unchanged if no vendor tags are defined.

The vendor_tag_ops structure used here is defined in: system/media/camera/include/system/vendor_tags.h

Version information (based on camera_module_t.common.module_api_version):

CAMERA_MODULE_API_VERSION_1_x/2_0/2_1: Not provided by HAL module. Framework may not call this function.

CAMERA_MODULE_API_VERSION_2_2: Valid to be called by the framework.

Definition at line 379 of file camera_common.h.

int(* open_legacy)(const struct hw_module_t *module, const char *id, uint32_t halVersion, struct hw_device_t **device)

open_legacy:

Open a specific legacy camera HAL device if multiple device HAL API versions are supported by this camera HAL module. For example, if the camera module supports both CAMERA_DEVICE_API_VERSION_1_0 and CAMERA_DEVICE_API_VERSION_3_2 device API for the same camera id, framework can call this function to open the camera device as CAMERA_DEVICE_API_VERSION_1_0 device.

This is an optional method. A Camera HAL module does not need to support more than one device HAL version per device, and such modules may return -ENOSYS for all calls to this method. For all older HAL device API versions that are not supported, it may return -EOPNOTSUPP. When above cases occur, The normal open() method (common.methods->open) will be used by the framework instead.

Version information (based on camera_module_t.common.module_api_version):

CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2: Not provided by HAL module. Framework will not call this function.

CAMERA_MODULE_API_VERSION_2_3: Valid to be called by the framework.

Return values:

0: On a successful open of the camera device.

-ENOSYS This method is not supported.

-EOPNOTSUPP: The requested HAL version is not supported by this method.

-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 common.methods->open method), 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 common.methods->open method.

Definition at line 425 of file camera_common.h.

void* reserved[7]

Definition at line 429 of file camera_common.h.

int(* set_callbacks)(const camera_module_callbacks_t *callbacks)

set_callbacks:

Provide callback function pointers to the HAL module to inform framework of asynchronous camera module events. The framework will call this function once after initial camera HAL module load, after the get_number_of_cameras() method is called for the first time, and before any other calls to the module.

Version information (based on camera_module_t.common.module_api_version):

CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0:

Not provided by HAL module. Framework may not call this function.

CAMERA_MODULE_API_VERSION_2_1:

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

Definition at line 359 of file camera_common.h.


The documentation for this struct was generated from the following file: