From: Christian Hoffmann Date: Sat, 10 Feb 2024 09:15:10 +0000 (+0100) Subject: hidl: camera: Allow to insert get_cam_pos function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cde582d00c3d3aab864c61037a813f47c9cc1cec;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung.git hidl: camera: Allow to insert get_cam_pos function * V1 for gtowifi * V2 for gta4l Co-authored-by: Han Sol Jin Change-Id: Ia6f3e15cad28c402f6ff459949e2917ba8dcf300 --- diff --git a/hidl/camera/libhardware_headers/Android.bp b/hidl/camera/libhardware_headers/Android.bp index 545c7aa..4aa6f3a 100644 --- a/hidl/camera/libhardware_headers/Android.bp +++ b/hidl/camera/libhardware_headers/Android.bp @@ -3,6 +3,8 @@ soong_config_module_type { module_type: "cc_defaults", config_namespace: "samsungCameraVars", bool_variables: [ + "needs_sec_get_cam_pos_v1", + "needs_sec_get_cam_pos_v2", "needs_sec_reserved_field", "usage_64bit", ], @@ -12,6 +14,12 @@ soong_config_module_type { samsung_camera3 { name: "samsung_camera3_defaults", soong_config_variables: { + needs_sec_get_cam_pos_v1: { + cflags: ["-DCAMERA_NEEDS_SEC_GET_CAM_POS_V1"], + }, + needs_sec_get_cam_pos_v2: { + cflags: ["-DCAMERA_NEEDS_SEC_GET_CAM_POS_V2"], + }, needs_sec_reserved_field: { cflags: ["-DCAMERA_NEEDS_SEC_RESERVED_FIELD"], }, diff --git a/hidl/camera/libhardware_headers/include/hardware/camera_common.h b/hidl/camera/libhardware_headers/include/hardware/camera_common.h index 16b4498..dc0ad25 100644 --- a/hidl/camera/libhardware_headers/include/hardware/camera_common.h +++ b/hidl/camera/libhardware_headers/include/hardware/camera_common.h @@ -904,6 +904,23 @@ typedef struct camera_module { * to manage number of external cameras. */ int (*get_number_of_cameras)(void); + +#ifdef CAMERA_NEEDS_SEC_GET_CAM_POS_V1 + /** + * get_cam_pos: + * + * Unknown. Needed by prebuilt camera module from the Samsung GTO device. + * + * Return values found so far: + * + * 0: On a successful operation + * + * -EINVAL: The input arguments are invalid + * + */ + int (*get_cam_pos)(void); +#endif + /** * get_camera_info: * @@ -930,6 +947,22 @@ typedef struct camera_module { */ int (*get_camera_info)(int camera_id, struct camera_info *info); +#ifdef CAMERA_NEEDS_SEC_GET_CAM_POS_V2 + /** + * get_cam_pos: + * + * Unknown. Needed by prebuilt camera module from the Samsung GTA4L device. + * + * Return values found so far: + * + * 0: On a successful operation + * + * -EINVAL: The input arguments are invalid + * + */ + int (*get_cam_pos)(void); +#endif + /** * set_callbacks: *