From 9b836eb97ef09e96676443ed2bc8ed27e8c76144 Mon Sep 17 00:00:00 2001 From: Sauhard Pande Date: Thu, 18 May 2017 18:36:05 +0530 Subject: [PATCH] Camera: HIDL extension to support extended FD feature. Added HIDL extension for camera device to pass extra added fields of camera face. Change-Id: I968132c3e3270f5cfa0b3347cb5bce035759a6ec --- camera/Android.bp | 3 + camera/device/1.0/Android.bp | 66 ++++++++++++ camera/device/1.0/IQCameraDeviceCallback.hal | 39 +++++++ camera/device/1.0/types.hal | 105 +++++++++++++++++++ camera/device/Android.bp | 4 + 5 files changed, 217 insertions(+) create mode 100644 camera/Android.bp create mode 100644 camera/device/1.0/Android.bp create mode 100644 camera/device/1.0/IQCameraDeviceCallback.hal create mode 100644 camera/device/1.0/types.hal create mode 100644 camera/device/Android.bp diff --git a/camera/Android.bp b/camera/Android.bp new file mode 100644 index 0000000..dd86b40 --- /dev/null +++ b/camera/Android.bp @@ -0,0 +1,3 @@ +subdirs = [ + "device/1.0", +] diff --git a/camera/device/1.0/Android.bp b/camera/device/1.0/Android.bp new file mode 100644 index 0000000..f5edf0d --- /dev/null +++ b/camera/device/1.0/Android.bp @@ -0,0 +1,66 @@ +// This file is autogenerated by hidl-gen. Do not edit manually. + +filegroup { + name: "vendor.qti.hardware.camera.device@1.0_hal", + srcs: [ + "types.hal", + "IQCameraDeviceCallback.hal", + ], +} + +genrule { + name: "vendor.qti.hardware.camera.device@1.0_genc++", + tools: ["hidl-gen"], + cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces/ -randroid.hidl:system/libhidl/transport/ -rvendor.qti.hardware:vendor/qcom/opensource/interfaces vendor.qti.hardware.camera.device@1.0", + srcs: [ + ":vendor.qti.hardware.camera.device@1.0_hal", + ], + out: [ + "vendor/qti/hardware/camera/device/1.0/types.cpp", + "vendor/qti/hardware/camera/device/1.0/QCameraDeviceCallbackAll.cpp", + ], +} + +genrule { + name: "vendor.qti.hardware.camera.device@1.0_genc++_headers", + tools: ["hidl-gen"], + cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces/ -randroid.hidl:system/libhidl/transport/ -rvendor.qti.hardware:vendor/qcom/opensource/interfaces vendor.qti.hardware.camera.device@1.0", + srcs: [ + ":vendor.qti.hardware.camera.device@1.0_hal", + ], + out: [ + "vendor/qti/hardware/camera/device/1.0/types.h", + "vendor/qti/hardware/camera/device/1.0/hwtypes.h", + "vendor/qti/hardware/camera/device/1.0/IQCameraDeviceCallback.h", + "vendor/qti/hardware/camera/device/1.0/IHwQCameraDeviceCallback.h", + "vendor/qti/hardware/camera/device/1.0/BnHwQCameraDeviceCallback.h", + "vendor/qti/hardware/camera/device/1.0/BpHwQCameraDeviceCallback.h", + "vendor/qti/hardware/camera/device/1.0/BsQCameraDeviceCallback.h", + ], +} + +cc_library_shared { + name: "vendor.qti.hardware.camera.device@1.0", + generated_sources: ["vendor.qti.hardware.camera.device@1.0_genc++"], + generated_headers: ["vendor.qti.hardware.camera.device@1.0_genc++_headers"], + export_generated_headers: ["vendor.qti.hardware.camera.device@1.0_genc++_headers"], + vendor: true, + shared_libs: [ + "libhidlbase", + "libhidltransport", + "libhwbinder", + "liblog", + "libutils", + "libcutils", + "android.hardware.camera.device@1.0", + "android.hidl.base@1.0", + ], + export_shared_lib_headers: [ + "libhidlbase", + "libhidltransport", + "libhwbinder", + "libutils", + "android.hardware.camera.device@1.0", + "android.hidl.base@1.0", + ], +} diff --git a/camera/device/1.0/IQCameraDeviceCallback.hal b/camera/device/1.0/IQCameraDeviceCallback.hal new file mode 100644 index 0000000..2cf589b --- /dev/null +++ b/camera/device/1.0/IQCameraDeviceCallback.hal @@ -0,0 +1,39 @@ +/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +package vendor.qti.hardware.camera.device@1.0; + +import android.hardware.camera.device@1.0::types; +import android.hardware.camera.device@1.0::ICameraDeviceCallback; + +interface IQCameraDeviceCallback extends ICameraDeviceCallback { + + QDataCallback(DataCallbackMsg msgType, MemoryId data, uint32_t bufferIndex, + QCameraFrameMetadata metadata); +}; diff --git a/camera/device/1.0/types.hal b/camera/device/1.0/types.hal new file mode 100644 index 0000000..ee17c2e --- /dev/null +++ b/camera/device/1.0/types.hal @@ -0,0 +1,105 @@ +/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +package vendor.qti.hardware.camera.device@1.0; + +import android.hardware.camera.device@1.0::types; + +/** + * Information for a single detected face. + */ + struct CameraFace { + /** + * Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents + * the top-left of the camera field of view, and (1000, 1000) represents the + * bottom-right of the field of view. The width and height cannot be 0 or + * negative. This is supported by both hardware and software face detection. + * + * The direction is relative to the sensor orientation, that is, what the + * sensor sees. The direction is not affected by the rotation or mirroring + * of CAMERA_CMD_SET_DISPLAY_ORIENTATION. + */ + int32_t[4] rect; + + /** + * The confidence level of the face. The range is 1 to 100. 100 is the + * highest confidence. This is supported by both hardware and software + * face detection. + */ + int32_t score; + + /** + * An unique id per face while the face is visible to the tracker. If + * the face leaves the field-of-view and comes back, it will get a new + * id. If the value is 0, id is not supported. + */ + int32_t id; + + /** + * The coordinates of the center of the left eye. The range is -1000 to + * 1000. -2000, -2000 if this is not supported. + */ + int32_t[2] leftEye; + + /** + * The coordinates of the center of the right eye. The range is -1000 to + * 1000. -2000, -2000 if this is not supported. + */ + int32_t[2] rightEye; + + /** + * The coordinates of the center of the mouth. The range is -1000 to 1000. + * -2000, -2000 if this is not supported. + */ + int32_t[2] mouth; + int32_t smile_degree; + int32_t smile_score; + int32_t blink_detected; + int32_t face_recognised; + int32_t gaze_angle; + int32_t updown_dir; + int32_t leftright_dir; + int32_t roll_dir; + int32_t left_right_gaze; + int32_t top_bottom_gaze; + int32_t leye_blink; + int32_t reye_blink; + +}; + +/** + * The metadata of the frame data, such as face detection result. + */ +struct QCameraFrameMetadata { + /** + * A vector of the detected faces. + */ + vec faces; +}; + diff --git a/camera/device/Android.bp b/camera/device/Android.bp new file mode 100644 index 0000000..a670087 --- /dev/null +++ b/camera/device/Android.bp @@ -0,0 +1,4 @@ +subdirs = [ + "1.0", +] +