camera3: Extend camera capture request for multiple cameras

The legacy camera 3.5 API should allow clients to set individual
settings for specific physical cameras that are part of
a logical multi-camera. 'camera3_capture_request_t' must
include additional arrays containing the required settings
and corresponding camera ids.

Test: Manual using camera application,
camera_client_test
Bug: 64691172

Change-Id: I634f1d5b87a6d97c5a35b8ea633c7a6c22793eaf
diff --git a/include/hardware/camera3.h b/include/hardware/camera3.h
index d140ae0..53e8d7b 100644
--- a/include/hardware/camera3.h
+++ b/include/hardware/camera3.h
@@ -178,6 +178,10 @@
  *   - Add physical camera id field in camera3_stream, so that for a logical
  *     multi camera, the application has the option to specify which physical camera
  *     a particular stream is configured on.
+ *
+ *   - Add physical camera id and settings field in camera3_capture_request, so that
+ *     for a logical multi camera, the application has the option to specify individual
+ *     settings for a particular physical device.
  */
 
 /**
@@ -2273,6 +2277,44 @@
      */
     const camera3_stream_buffer_t *output_buffers;
 
+    /**
+     * <= CAMERA_DEVICE_API_VERISON_3_4:
+     *
+     *    Not defined and must not be accessed.
+     *
+     * >= CAMERA_DEVICE_API_VERSION_3_5:
+     *    The number of physical camera settings to be applied. If 'num_physcam_settings'
+     *    equals 0 or a physical device is not included, then Hal must decide the
+     *    specific physical device settings based on the default 'settings'.
+     */
+    uint32_t num_physcam_settings;
+
+    /**
+     * <= CAMERA_DEVICE_API_VERISON_3_4:
+     *
+     *    Not defined and must not be accessed.
+     *
+     * >= CAMERA_DEVICE_API_VERSION_3_5:
+     *    The physical camera ids. The array will contain 'num_physcam_settings'
+     *    camera id strings for all physical devices that have specific settings.
+     *    In case some id is invalid, the process capture request must fail and return
+     *    -EINVAL.
+     */
+    const char **physcam_id;
+
+    /**
+     * <= CAMERA_DEVICE_API_VERISON_3_4:
+     *
+     *    Not defined and must not be accessed.
+     *
+     * >= CAMERA_DEVICE_API_VERSION_3_5:
+     *    The capture settings for the physical cameras. The array will contain
+     *    'num_physcam_settings' settings for invididual physical devices. In
+     *    case the settings at some particular index are empty, the process capture
+     *    request must fail and return -EINVAL.
+     */
+    const camera_metadata_t **physcam_settings;
+
 } camera3_capture_request_t;
 
 /**
@@ -2982,7 +3024,8 @@
      *  0:      On a successful start to processing the capture request
      *
      * -EINVAL: If the input is malformed (the settings are NULL when not
-     *          allowed, there are 0 output buffers, etc) and capture processing
+     *          allowed, invalid physical camera settings,
+     *          there are 0 output buffers, etc) and capture processing
      *          cannot start. Failures during request processing should be
      *          handled by calling camera3_callback_ops_t.notify(). In case of
      *          this error, the framework will retain responsibility for the