diff options
author | Alex Ray <aray@google.com> | 2013-10-17 21:52:03 -0700 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2013-10-21 12:20:41 -0700 |
commit | 7915e97d637df3ebbdb9fda542a2657236361e14 (patch) | |
tree | f8e5893f536b8791148c4d6608ad97f9563ba7c0 /modules/camera/CameraHAL.cpp | |
parent | 61f7a0c1c1aa481d798116e5a218df04630886e6 (diff) | |
download | hardware_libhardware-7915e97d637df3ebbdb9fda542a2657236361e14.zip hardware_libhardware-7915e97d637df3ebbdb9fda542a2657236361e14.tar.gz hardware_libhardware-7915e97d637df3ebbdb9fda542a2657236361e14.tar.bz2 |
modules: camera: add vendor tag functionality
Vendor Tag operations were added in module api v2.2
Change-Id: I352a50759d8bb9389d904bb774659e4be883794b
Diffstat (limited to 'modules/camera/CameraHAL.cpp')
-rw-r--r-- | modules/camera/CameraHAL.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/modules/camera/CameraHAL.cpp b/modules/camera/CameraHAL.cpp index 9a13c98..148f99c 100644 --- a/modules/camera/CameraHAL.cpp +++ b/modules/camera/CameraHAL.cpp @@ -18,6 +18,7 @@ #include <hardware/camera_common.h> #include <hardware/hardware.h> #include "ExampleCamera.h" +#include "VendorTags.h" //#define LOG_NDEBUG 0 #define LOG_TAG "DefaultCameraHAL" @@ -38,6 +39,8 @@ namespace default_camera_hal { // Default Camera HAL has 2 cameras, front and rear. static CameraHAL gCameraHAL(2); +// Handle containing vendor tag functionality +static VendorTags gVendorTags; CameraHAL::CameraHAL(int num_cameras) : mNumberOfCameras(num_cameras), @@ -121,6 +124,41 @@ static int set_callbacks(const camera_module_callbacks_t *callbacks) return gCameraHAL.setCallbacks(callbacks); } +static int get_tag_count(const vendor_tag_ops_t* ops) +{ + return gVendorTags.getTagCount(ops); +} + +static void get_all_tags(const vendor_tag_ops_t* ops, uint32_t* tag_array) +{ + gVendorTags.getAllTags(ops, tag_array); +} + +static const char* get_section_name(const vendor_tag_ops_t* ops, uint32_t tag) +{ + return gVendorTags.getSectionName(ops, tag); +} + +static const char* get_tag_name(const vendor_tag_ops_t* ops, uint32_t tag) +{ + return gVendorTags.getTagName(ops, tag); +} + +static int get_tag_type(const vendor_tag_ops_t* ops, uint32_t tag) +{ + return gVendorTags.getTagType(ops, tag); +} + +static void get_vendor_tag_ops(vendor_tag_ops_t* ops) +{ + ALOGV("%s : ops=%p", __func__, ops); + ops->get_tag_count = get_tag_count; + ops->get_all_tags = get_all_tags; + ops->get_section_name = get_section_name; + ops->get_tag_name = get_tag_name; + ops->get_tag_type = get_tag_type; +} + static int open_dev(const hw_module_t* mod, const char* name, hw_device_t** dev) { return gCameraHAL.open(mod, name, dev); @@ -133,7 +171,7 @@ static hw_module_methods_t gCameraModuleMethods = { camera_module_t HAL_MODULE_INFO_SYM __attribute__ ((visibility("default"))) = { common : { tag : HARDWARE_MODULE_TAG, - module_api_version : CAMERA_MODULE_API_VERSION_2_0, + module_api_version : CAMERA_MODULE_API_VERSION_2_2, hal_api_version : HARDWARE_HAL_API_VERSION, id : CAMERA_HARDWARE_MODULE_ID, name : "Default Camera HAL", @@ -144,7 +182,8 @@ camera_module_t HAL_MODULE_INFO_SYM __attribute__ ((visibility("default"))) = { }, get_number_of_cameras : get_number_of_cameras, get_camera_info : get_camera_info, - set_callbacks : set_callbacks + set_callbacks : set_callbacks, + get_vendor_tag_ops : get_vendor_tag_ops }; } // extern "C" |