hidl: camera: Allow to insert get_cam_pos function
authorChristian Hoffmann <chrmhoffmann@gmail.com>
Sat, 10 Feb 2024 09:15:10 +0000 (10:15 +0100)
committerŁukasz Patron <priv.luk@gmail.com>
Sun, 11 Feb 2024 10:11:06 +0000 (10:11 +0000)
* V1 for gtowifi
* V2 for gta4l

Co-authored-by: Han Sol Jin <hansol@hansol.ca>
Change-Id: Ia6f3e15cad28c402f6ff459949e2917ba8dcf300

hidl/camera/libhardware_headers/Android.bp
hidl/camera/libhardware_headers/include/hardware/camera_common.h

index 545c7aa0de0d808d2883dfac2e6889e02c901dde..4aa6f3a181d359d656662d24cba7eb2e883c0e88 100644 (file)
@@ -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"],
         },
index 16b449841fcf8e7191a1130cf908a615f9acde7b..dc0ad25dc55469fdbb3377db0a22523b8c2575f9 100644 (file)
@@ -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:
      *