From 9ca871ae24fbf7c5131c15d1acd38c9e8b840a5a Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Sat, 5 Feb 2022 15:37:52 -0800 Subject: [PATCH] Add stream use cases to camera aidl interfaces. Bug: 196432585 Test: build Change-Id: I1b2628056949d05aa553bdbba7983628ec54d65b Signed-off-by: Jayant Chowdhary --- .../hardware/camera/device/Stream.aidl | 1 + .../hardware/camera/device/Stream.aidl | 19 ++++++++ .../camera/metadata/CameraMetadataTag.aidl | 1 + .../ScalerAvailableStreamUseCases.aidl | 48 +++++++++++++++++++ .../camera/metadata/CameraMetadataTag.aidl | 6 +++ .../ScalerAvailableStreamUseCases.aidl | 39 +++++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl index 9263a0391c..d2f295a160 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl @@ -47,4 +47,5 @@ parcelable Stream { int groupId; android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; } diff --git a/camera/device/aidl/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/android/hardware/camera/device/Stream.aidl index b3291b0fdd..e35e4ff6e6 100644 --- a/camera/device/aidl/android/hardware/camera/device/Stream.aidl +++ b/camera/device/aidl/android/hardware/camera/device/Stream.aidl @@ -203,4 +203,23 @@ parcelable Stream { * */ android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + + /** + * The stream use case describing the stream's purpose + * + * This flag provides the camera device a hint on what user scenario this + * stream is intended for. With this flag, the camera device can optimize + * camera pipeline parameters, such as tuning, sensor mode, and ISP settings, + * for the intended use case. + * + * When this field is set to DEFAULT, the camera device should behave in + * the same way as in previous HAL versions, and optimize the camera pipeline + * based on stream format, data space, usage flag, and other stream properties. + * + * The HAL reports supported stream use cases in + * ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES. If the HAL doesn't support + * setting stream use cases, the camera framework leaves this field as + * DEFAULT. + */ + android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; } diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl index 34a1211d31..432c9fd2ac 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -195,6 +195,7 @@ enum CameraMetadataTag { ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851989, ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851990, ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851991, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851992, ANDROID_SENSOR_EXPOSURE_TIME = 917504, ANDROID_SENSOR_FRAME_DURATION = 917505, ANDROID_SENSOR_SENSITIVITY = 917506, diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl new file mode 100644 index 0000000000..0ed55a325e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.metadata; +@Backing(type="int") @VintfStability +enum ScalerAvailableStreamUseCases { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 1, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 2, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 3, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 4, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 5, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 65536, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index fb7ca1241d..1f388d9c38 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -1224,6 +1224,12 @@ enum CameraMetadataTag { *

Whether the camera device supports multi-resolution input or output streams

*/ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED, + /** + * android.scaler.availableStreamUseCases [static, enum[], public] + * + *

The stream use cases supported by this camera device.

+ */ + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, /** * android.sensor.exposureTime [dynamic, int64, public] * diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl new file mode 100644 index 0000000000..19ebab5a0a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.scaler.availableStreamUseCases enumeration values + * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES + */ +@VintfStability +@Backing(type="int") +enum ScalerAvailableStreamUseCases { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 0x4, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000, +}