Delete HIDL 3.8
- HIDL camera device@3.8, metadata@3.8 were temporary interfaces
Bug: 221108824
Test: GCA
Test: Camera CTS
Merged-In: I44cd1ac0e2f6647e3e9d5c60a535faf716d5ed93
Change-Id: I44cd1ac0e2f6647e3e9d5c60a535faf716d5ed93
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 406da449098d5afb6812d600ba76ea2bb1c16ff9)
diff --git a/camera/device/3.8/Android.bp b/camera/device/3.8/Android.bp
deleted file mode 100644
index c3c2941..0000000
--- a/camera/device/3.8/Android.bp
+++ /dev/null
@@ -1,39 +0,0 @@
-// This file is autogenerated by hidl-gen -Landroidbp.
-
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-hidl_interface {
- name: "android.hardware.camera.device@3.8",
- root: "android.hardware",
- srcs: [
- "types.hal",
- "ICameraDevice.hal",
- "ICameraDeviceCallback.hal",
- "ICameraDeviceSession.hal",
- ],
- interfaces: [
- "android.hardware.camera.common@1.0",
- "android.hardware.camera.device@3.2",
- "android.hardware.camera.device@3.3",
- "android.hardware.camera.device@3.4",
- "android.hardware.camera.device@3.5",
- "android.hardware.camera.device@3.6",
- "android.hardware.camera.device@3.7",
- "android.hardware.camera.metadata@3.2",
- "android.hardware.camera.metadata@3.3",
- "android.hardware.camera.metadata@3.4",
- "android.hardware.camera.metadata@3.5",
- "android.hardware.camera.metadata@3.6",
- "android.hardware.camera.metadata@3.8",
- "android.hardware.graphics.common@1.0",
- "android.hidl.base@1.0",
- ],
- gen_java: false,
-}
diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal
deleted file mode 100644
index 09edb8b..0000000
--- a/camera/device/3.8/ICameraDevice.hal
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-package android.hardware.camera.device@3.8;
-
-import android.hardware.camera.common@1.0::Status;
-import @3.7::ICameraDevice;
-
-/**
- * Camera device interface
- *
- * Supports the android.hardware.Camera API, and the android.hardware.camera2
- * API at LIMITED or better hardware level.
- *
- * ICameraDevice.open() must return @3.2::ICameraDeviceSession,
- * @3.5::ICameraDeviceSession, @3.6::ICameraDeviceSession,
- * @3.7::ICameraDeviceSession, or @3.8::ICameraDeviceSession.
- */
-interface ICameraDevice extends @3.7::ICameraDevice {
- /**
- * turnOnTorchWithStrengthLevel:
- *
- * Change the brightness level of the flash unit associated with this camera device
- * and set it to value in torchStrength. This function also turns ON the torch
- * with specified torchStrength if the torch is OFF.
- *
- * The torchStrength value must be within the valid range i.e. >=1 and
- * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF,
- * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL.
- * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N),
- * the flash unit will have brightness level equal to N. This level does not
- * represent the real brightness units. It is linear in nature i.e. flashlight
- * at level 10 is twice as bright as at level 5.
- *
- * @param torchStrength Brightness level to be set for the flashlight.
- *
- * @return status Status code for the operation, one of:
- * OK:
- * On a successful change to the torch strength level.
- * INTERNAL_ERROR:
- * The flash unit cannot be operated due to an unexpected internal
- * error.
- * CAMERA_IN_USE:
- * This status code is returned when:
- * - This camera device has been opened, so the torch cannot be
- * controlled until it is closed.
- * - Due to other camera devices being open, or due to other
- * resource constraints, the torch cannot be controlled currently.
- * ILLEGAL_ARGUMENT:
- * If the torchStrength value is not within the range i.e. < 1 or
- * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL.
- * METHOD_NOT_SUPPORTED:
- * This status code is returned when:
- * - This camera device does not support direct operation of flashlight
- * torch mode. The framework must open the camera device and turn
- * the torch on through the device interface.
- * - This camera device does not have a flash unit.
- * - This camera device has flash unit but does not support torch
- * strength control.
- * CAMERA_DISCONNECTED:
- * An external camera device has been disconnected, and is no longer
- * available. This camera device interface is now stale, and a new
- * instance must be acquired if the device is reconnected. All
- * subsequent calls on this interface must return
- * CAMERA_DISCONNECTED.
- *
- */
- turnOnTorchWithStrengthLevel(int32_t torchStrength) generates (Status status);
-
- /**
- * getTorchStrengthLevel:
- *
- * Get current torch strength level.
- * If the device supports torch strength control, when the torch is OFF the
- * strength level will reset to default level, so the return
- * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL.
- *
- * @return status Status code for the operation, one of:
- * OK:
- * On success.
- * INTERNAL_ERROR:
- * An unexpected error occurred and the information is not
- * available.
- * METHOD_NOT_SUPPORTED:
- * This status code is returned when:
- * - This camera device does not support direct operation of flashlight
- * torch mode. The framework must open the camera device and turn
- * the torch on through the device interface.
- * - This camera device does not have a flash unit.
- * - This camera device has flash unit but does not support torch
- * strength control.
- *
- * @return torchStrength Current torch strength level.
- *
- */
- getTorchStrengthLevel() generates (Status status, int32_t torchStrength);
-
- /**
- * isStreamCombinationSupported_3_8:
- *
- * Identical to @3.7::ICameraDevice.isStreamCombinationSupported, except
- * that it takes a @3.8::StreamConfiguration parameter, which could contain
- * additional information about a specific 10-bit dynamic range profile or
- * stream use case.
- *
- */
- isStreamCombinationSupported_3_8(StreamConfiguration streams)
- generates (Status status, bool queryStatus);
-};
diff --git a/camera/device/3.8/ICameraDeviceCallback.hal b/camera/device/3.8/ICameraDeviceCallback.hal
deleted file mode 100644
index de0775d..0000000
--- a/camera/device/3.8/ICameraDeviceCallback.hal
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-package android.hardware.camera.device@3.8;
-
-import @3.5::ICameraDeviceCallback;
-
-/**
- * Callback methods for the HAL to call into the framework.
- */
-interface ICameraDeviceCallback extends @3.5::ICameraDeviceCallback {
- /**
- * Identical to @3.5::ICameraDeviceCallback.notify, except that it takes a
- * list of @3.8::NotifyMsg which contain readout timestamp in addition
- * to exposure start timestamp for shutter.
- *
- * The readout timestamp is used for the framework to re-time the viewfinder
- * frames targeted for SurfaceView so that preview jitter can be reduced.
- */
- notify_3_8(vec<NotifyMsg> msgs);
-};
diff --git a/camera/device/3.8/ICameraDeviceSession.hal b/camera/device/3.8/ICameraDeviceSession.hal
deleted file mode 100644
index c3aa836..0000000
--- a/camera/device/3.8/ICameraDeviceSession.hal
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-package android.hardware.camera.device@3.8;
-
-import android.hardware.camera.common@1.0::Status;
-import @3.5::StreamConfiguration;
-import @3.7::ICameraDeviceSession;
-import @3.6::HalStreamConfiguration;
-
-/**
- * Camera device active session interface.
- *
- * Obtained via ICameraDevice::open(), this interface contains the methods to
- * configure and request captures from an active camera device.
- */
-interface ICameraDeviceSession extends @3.7::ICameraDeviceSession {
- /**
- * configureStreams_3_8:
- *
- * Identical to @3.7::ICameraDeviceSession.configureStreams_3_7, except that:
- *
- * - The requestedConfiguration allows the camera framework to configure
- * 10-bit dynamic range profile.
- * - The requestedConfiguration allows the camera framework to configure
- * stream use cases.
- *
- * @return status Status code for the operation, one of:
- * OK:
- * On successful stream configuration.
- * INTERNAL_ERROR:
- * If there has been a fatal error and the device is no longer
- * operational. Only close() can be called successfully by the
- * framework after this error is returned.
- * ILLEGAL_ARGUMENT:
- * If the requested stream configuration is invalid. Some examples
- * of invalid stream configurations include:
- * - Including more than 1 INPUT stream
- * - Not including any OUTPUT streams
- * - Including streams with unsupported formats, or an unsupported
- * size for that format.
- * - Including too many output streams of a certain format.
- * - Unsupported rotation configuration
- * - Stream sizes/formats don't satisfy the
- * StreamConfigurationMode requirements
- * for non-NORMAL mode, or the requested operation_mode is not
- * supported by the HAL.
- * - Unsupported usage flag
- * - Unsupported stream groupIds, or unsupported multi-resolution
- * input stream.
- * - Invalid combination between a 10-bit dynamic range profile
- * and none impl. defined 8-bit format for a particular stream.
- * - Unsupported stream use case
- * The camera service cannot filter out all possible illegal stream
- * configurations, since some devices may support more simultaneous
- * streams or larger stream resolutions than the minimum required
- * for a given camera device hardware level. The HAL must return an
- * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
- * ready to accept a future valid stream configuration in a later
- * configureStreams call.
- * @return halConfiguration The stream parameters desired by the HAL for
- * each stream, including maximum buffers, the usage flags, and the
- * override format and dataspace.
- */
- configureStreams_3_8(StreamConfiguration requestedConfiguration)
- generates (Status status, @3.6::HalStreamConfiguration halConfiguration);
-
- /**
- * repeatingRequestEnd:
- *
- * Notification about the last frame number in a repeating request along with the
- * ids of all streams included in the repeating request.
- *
- * This can be called at any point after 'processCaptureRequest' in response
- * to camera clients disabling an active repeating request.
- *
- * Performance requirements:
- * The call must not be blocked for extensive periods and should be extremely lightweight. There
- * must be no frame rate degradation or frame jitter introduced.
- *
- * This method must always succeed, even if the device has encountered a
- * serious error.
- */
- repeatingRequestEnd(uint32_t frameNumber, vec<int32_t> streamIds);
-};
diff --git a/camera/device/3.8/types.hal b/camera/device/3.8/types.hal
deleted file mode 100644
index 04a2450..0000000
--- a/camera/device/3.8/types.hal
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-package android.hardware.camera.device@3.8;
-
-import @3.2::ErrorMsg;
-import @3.2::CameraMetadata;
-import @3.2::MsgType;
-import @3.2::ShutterMsg;
-import @3.2::CameraMetadata;
-import @3.2::StreamConfigurationMode;
-import @3.7::Stream;
-
-import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap;
-import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidScalerAvailableStreamUseCases;
-
-/**
- * ShutterMsg:
- *
- * Message contents for MsgType::SHUTTER
- *
- * This version extends the @3.2 ShutterMsg with the readout timestamp.
- */
-struct ShutterMsg {
- /**
- * The definition of ShutterMsg from prior version.
- */
- @3.2::ShutterMsg v3_2;
-
- /**
- * Timestamp for the capture readout. This must be in the same time domain
- * as v3_2.timestamp, and for a rolling shutter sensor, the value must be
- * v3_2.timestamp + exposureTime + t_crop_top where t_crop_top is the exposure time
- * skew of the cropped lines on the top.
- */
- uint64_t readoutTimestamp;
-};
-
-/**
- * NotifyMsg:
- *
- * The message structure sent to ICameraDevice3Callback::notify()
- *
- * This version extends the @3.2 NotifyMsg with the @3.8 version of ShutterMsg.
- */
-struct NotifyMsg {
- /**
- * The message type.
- */
- @3.2::MsgType type;
-
- union Message {
- /**
- * Error message contents. Valid if type is MsgType::ERROR
- */
- @3.2::ErrorMsg error;
-
- /**
- * Shutter message contents. Valid if type is MsgType::SHUTTER
- */
- ShutterMsg shutter;
- } msg;
-};
-
-/**
- * Stream:
- *
- * A descriptor for a single camera input or output stream. A stream is defined
- * by the framework by its buffer resolution and format, and additionally by the
- * HAL with the gralloc usage flags and the maximum in-flight buffer count.
- *
- * This version extends the @3.7 Stream with the dynamic range profile and the
- * stream use case field.
- */
-struct Stream {
- /**
- * The definition of Stream from the prior version.
- */
- @3.7::Stream v3_7;
-
- /**
- * The dynamic range profile for this stream.
- *
- * This field is valid and must only be considered for streams with format
- * android.hardware.graphics.common.PixelFormat.YCBCR_P010 or
- * android.hardware.graphics.common.PixelFormat.IMPLEMENTATION_DEFINED on devices supporting the
- * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_10_BIT capability.
- *
- */
- CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap 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.
- */
- CameraMetadataEnumAndroidScalerAvailableStreamUseCases useCase;
-};
-
-/**
- * StreamConfiguration:
- *
- * Identical to @3.7::StreamConfiguration, except that the streams
- * vector contains @3.8::Stream.
- */
-struct StreamConfiguration {
- /**
- * An array of camera stream pointers, defining the input/output
- * configuration for the camera HAL device.
- */
- vec<Stream> streams;
-
- /**
- * The definition of operation mode from prior version.
- */
- @3.2::StreamConfigurationMode operationMode;
-
- /**
- * The definition of session parameters from prior version.
- */
- @3.2::CameraMetadata sessionParams;
-
- /**
- * The definition of stream configuration counter from prior version.
- */
- uint32_t streamConfigCounter;
-
- /**
- * The definition of multi-resolution input image flag from prior version.
- */
- bool multiResolutionInputImage;
-};
diff --git a/camera/metadata/3.8/Android.bp b/camera/metadata/3.8/Android.bp
deleted file mode 100644
index ead9543..0000000
--- a/camera/metadata/3.8/Android.bp
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file is autogenerated by hidl-gen -Landroidbp.
-
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-hidl_interface {
- name: "android.hardware.camera.metadata@3.8",
- root: "android.hardware",
- srcs: [
- "types.hal",
- ],
- interfaces: [
- "android.hardware.camera.metadata@3.2",
- "android.hardware.camera.metadata@3.3",
- "android.hardware.camera.metadata@3.4",
- "android.hardware.camera.metadata@3.5",
- "android.hardware.camera.metadata@3.6",
- "android.hardware.camera.metadata@3.7",
- ],
- gen_java: true,
-}
diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal
deleted file mode 100644
index 8cc6646..0000000
--- a/camera/metadata/3.8/types.hal
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (C) 2021 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@3.8;
-
-import android.hardware.camera.metadata@3.2;
-import android.hardware.camera.metadata@3.3;
-import android.hardware.camera.metadata@3.4;
-import android.hardware.camera.metadata@3.5;
-import android.hardware.camera.metadata@3.6;
-import android.hardware.camera.metadata@3.7;
-
-/**
- * Top level hierarchy definitions for camera metadata. *_INFO sections are for
- * the static metadata that can be retrieved without opening the camera device.
- */
-enum CameraMetadataSection : @3.4::CameraMetadataSection {
- ANDROID_AUTOMOTIVE =
- android.hardware.camera.metadata@3.4::CameraMetadataSection:ANDROID_SECTION_COUNT,
-
- ANDROID_AUTOMOTIVE_LENS,
-
- ANDROID_SECTION_COUNT_3_8,
-
- VENDOR_SECTION_3_8 = 0x8000,
-
-};
-
-/**
- * Hierarchy positions in enum space. All vendor extension sections must be
- * defined with tag >= VENDOR_SECTION_START
- */
-enum CameraMetadataSectionStart : android.hardware.camera.metadata@3.4::CameraMetadataSectionStart {
- ANDROID_AUTOMOTIVE_START = CameraMetadataSection:ANDROID_AUTOMOTIVE << 16,
-
- ANDROID_AUTOMOTIVE_LENS_START = CameraMetadataSection:ANDROID_AUTOMOTIVE_LENS << 16,
-
- VENDOR_SECTION_START_3_8 = CameraMetadataSection:VENDOR_SECTION_3_8 << 16,
-
-};
-
-/**
- * Main enumeration for defining camera metadata tags added in this revision
- *
- * <p>Partial documentation is included for each tag; for complete documentation, reference
- * '/system/media/camera/docs/docs.html' in the corresponding Android source tree.</p>
- */
-enum CameraMetadataTag : @3.7::CameraMetadataTag {
- /** android.flash.info.strengthMaximumLevel [static, int32, public]
- *
- * <p>Maximum flashlight brightness level.</p>
- */
- ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL = android.hardware.camera.metadata@3.2::CameraMetadataTag:ANDROID_FLASH_INFO_END,
-
- /** android.flash.info.strengthDefaultLevel [static, int32, public]
- *
- * <p>Default flashlight brightness level to be set via
- * {android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel}.</p>
- */
- ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL,
-
- ANDROID_FLASH_INFO_END_3_8,
-
- /** android.request.availableDynamicRangeProfilesMap [static, enum[], ndk_public]
- *
- * <p>A map of all available 10-bit dynamic range profiles along with their
- * capture request constraints.</p>
- */
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_REQUEST_END_3_4,
-
- /** android.request.recommendedTenBitDynamicRangeProfile [static, int64, java_public]
- *
- * <p>Recommended 10-bit dynamic range profile.</p>
- */
- ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE,
-
- ANDROID_REQUEST_END_3_8,
-
- /** android.scaler.availableStreamUseCases [static, enum[], public]
- *
- * <p>The stream use cases supported by this camera device.</p>
- */
- ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = android.hardware.camera.metadata@3.6::CameraMetadataTag:ANDROID_SCALER_END_3_6,
-
- ANDROID_SCALER_END_3_8,
-
- /** android.automotive.location [static, enum, public]
- *
- * <p>Location of the cameras on the automotive devices.</p>
- */
- ANDROID_AUTOMOTIVE_LOCATION = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_START,
-
- ANDROID_AUTOMOTIVE_END_3_8,
-
- /** android.automotive.lens.facing [static, enum[], public]
- *
- * <p>The direction of the camera faces relative to the vehicle body frame and the
- * passenger seats.</p>
- */
- ANDROID_AUTOMOTIVE_LENS_FACING = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_LENS_START,
-
- ANDROID_AUTOMOTIVE_LENS_END_3_8,
-
-};
-
-/*
- * Enumeration definitions for the various entries that need them
- */
-
-/** android.control.videoStabilizationMode enumeration values added since v3.2
- * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE
- */
-enum CameraMetadataEnumAndroidControlVideoStabilizationMode :
- @3.2::CameraMetadataEnumAndroidControlVideoStabilizationMode {
- ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION,
-};
-
-/** android.lens.poseReference enumeration values added since v3.5
- * @see ANDROID_LENS_POSE_REFERENCE
- */
-enum CameraMetadataEnumAndroidLensPoseReference :
- @3.5::CameraMetadataEnumAndroidLensPoseReference {
- ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE,
-};
-
-/** android.request.availableCapabilities enumeration values added since v3.6
- * @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES
- */
-enum CameraMetadataEnumAndroidRequestAvailableCapabilities :
- @3.6::CameraMetadataEnumAndroidRequestAvailableCapabilities {
- ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT,
- ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE,
-};
-
-/** android.request.availableDynamicRangeProfilesMap enumeration values
- * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP
- */
-enum CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap : int64_t {
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD
- = 0x1,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS
- = 0x8,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF
- = 0x10,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO
- = 0x20,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM
- = 0x40,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO
- = 0x80,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF
- = 0x100,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO
- = 0x200,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM
- = 0x400,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO
- = 0x800,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000,
-};
-
-/** android.scaler.availableRecommendedStreamConfigurations enumeration values added since v3.4
- * @see ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS
- */
-enum CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations :
- @3.4::CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations {
- ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT
- = 0x8,
- ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8
- = 0x9,
-};
-
-/** android.scaler.availableStreamUseCases enumeration values
- * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES
- */
-enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : int64_t {
- 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,
-};
-
-/** android.automotive.location enumeration values
- * @see ANDROID_AUTOMOTIVE_LOCATION
- */
-enum CameraMetadataEnumAndroidAutomotiveLocation : uint32_t {
- ANDROID_AUTOMOTIVE_LOCATION_INTERIOR,
- ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER,
- ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT,
- ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR,
- ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT,
- ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT,
- ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER,
- ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT,
- ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR,
- ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT,
- ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT,
-};
-
-/** android.automotive.lens.facing enumeration values
- * @see ANDROID_AUTOMOTIVE_LENS_FACING
- */
-enum CameraMetadataEnumAndroidAutomotiveLensFacing : uint32_t {
- ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER,
- ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT,
- ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR,
- ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT,
- ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER,
- ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT,
-};
diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp
index 2f24dfd..85e69eb 100644
--- a/camera/provider/2.4/vts/functional/Android.bp
+++ b/camera/provider/2.4/vts/functional/Android.bp
@@ -50,9 +50,7 @@
"android.hardware.camera.device@3.5",
"android.hardware.camera.device@3.6",
"android.hardware.camera.device@3.7",
- "android.hardware.camera.device@3.8",
"android.hardware.camera.metadata@3.4",
- "android.hardware.camera.metadata@3.8",
"android.hardware.camera.provider@2.4",
"android.hardware.camera.provider@2.5",
"android.hardware.camera.provider@2.6",
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index f89c71d..6866776 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -42,14 +42,9 @@
#include <android/hardware/camera/device/3.6/ICameraDevice.h>
#include <android/hardware/camera/device/3.6/ICameraDeviceSession.h>
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
-#include <android/hardware/camera/device/3.8/ICameraDevice.h>
#include <android/hardware/camera/device/3.7/ICameraDeviceSession.h>
-#include <android/hardware/camera/device/3.8/ICameraDeviceSession.h>
#include <android/hardware/camera/device/3.7/ICameraInjectionSession.h>
-#include <android/hardware/camera/device/3.8/ICameraDeviceCallback.h>
-#include <android/hardware/camera/device/3.8/ICameraDeviceSession.h>
#include <android/hardware/camera/metadata/3.4/types.h>
-#include <android/hardware/camera/metadata/3.8/types.h>
#include <android/hardware/camera/provider/2.4/ICameraProvider.h>
#include <android/hardware/camera/provider/2.5/ICameraProvider.h>
#include <android/hardware/camera/provider/2.6/ICameraProvider.h>
@@ -134,10 +129,6 @@
CameraMetadataEnumAndroidSensorInfoColorFilterArrangement;
using ::android::hardware::camera::metadata::V3_4::CameraMetadataTag;
using ::android::hardware::camera::metadata::V3_6::CameraMetadataEnumAndroidSensorPixelMode;
-using ::android::hardware::camera::metadata::V3_8::
- CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap;
-using ::android::hardware::camera::metadata::V3_8::
- CameraMetadataEnumAndroidScalerAvailableStreamUseCases;
using ::android::hardware::camera::provider::V2_4::ICameraProvider;
using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback;
using ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination;
@@ -233,8 +224,7 @@
namespace {
// "device@<version>/legacy/<id>"
- const char *kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/%s/(.+)";
- const int CAMERA_DEVICE_API_VERSION_3_8 = 0x308;
+ const char* kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/%s/(.+)";
const int CAMERA_DEVICE_API_VERSION_3_7 = 0x307;
const int CAMERA_DEVICE_API_VERSION_3_6 = 0x306;
const int CAMERA_DEVICE_API_VERSION_3_5 = 0x305;
@@ -242,19 +232,16 @@
const int CAMERA_DEVICE_API_VERSION_3_3 = 0x303;
const int CAMERA_DEVICE_API_VERSION_3_2 = 0x302;
const int CAMERA_DEVICE_API_VERSION_1_0 = 0x100;
- const char *kHAL3_8 = "3.8";
- const char *kHAL3_7 = "3.7";
- const char *kHAL3_6 = "3.6";
- const char *kHAL3_5 = "3.5";
- const char *kHAL3_4 = "3.4";
- const char *kHAL3_3 = "3.3";
- const char *kHAL3_2 = "3.2";
- const char *kHAL1_0 = "1.0";
+ const char* kHAL3_7 = "3.7";
+ const char* kHAL3_6 = "3.6";
+ const char* kHAL3_5 = "3.5";
+ const char* kHAL3_4 = "3.4";
+ const char* kHAL3_3 = "3.3";
+ const char* kHAL3_2 = "3.2";
+ const char* kHAL1_0 = "1.0";
- bool matchDeviceName(const hidl_string& deviceName,
- const hidl_string &providerType,
- std::string* deviceVersion,
- std::string* cameraId) {
+ bool matchDeviceName(const hidl_string& deviceName, const hidl_string& providerType,
+ std::string* deviceVersion, std::string* cameraId) {
::android::String8 pattern;
pattern.appendFormat(kDeviceNameRE, providerType.c_str());
std::regex e(pattern.string());
@@ -280,9 +267,7 @@
return -1;
}
- if (version.compare(kHAL3_8) == 0) {
- return CAMERA_DEVICE_API_VERSION_3_8;
- } else if (version.compare(kHAL3_7) == 0) {
+ if (version.compare(kHAL3_7) == 0) {
return CAMERA_DEVICE_API_VERSION_3_7;
} else if (version.compare(kHAL3_6) == 0) {
return CAMERA_DEVICE_API_VERSION_3_6;
@@ -652,7 +637,8 @@
}
virtual Return<void> processCaptureResult_3_4(
- const hidl_vec<V3_4::CaptureResult>& /*results*/) override {
+
+ const hidl_vec<V3_4::CaptureResult>& /*results*/) override {
ALOGI("processCaptureResult_3_4 callback");
ADD_FAILURE(); // Empty callback should not reach here
return Void();
@@ -682,44 +668,41 @@
}
};
- struct DeviceCb : public V3_8::ICameraDeviceCallback {
- DeviceCb(CameraHidlTest *parent, int deviceVersion, const camera_metadata_t *staticMeta) :
- mParent(parent), mDeviceVersion(deviceVersion) {
+ struct DeviceCb : public V3_5::ICameraDeviceCallback {
+ DeviceCb(CameraHidlTest* parent, int deviceVersion, const camera_metadata_t* staticMeta)
+ : mParent(parent), mDeviceVersion(deviceVersion) {
mStaticMetadata = staticMeta;
}
- Return<void> processCaptureResult_3_4(
- const hidl_vec<V3_4::CaptureResult>& results) override;
+ Return<void> processCaptureResult_3_4(const hidl_vec<V3_4::CaptureResult>& results) override;
Return<void> processCaptureResult(const hidl_vec<CaptureResult>& results) override;
Return<void> notify(const hidl_vec<NotifyMsg>& msgs) override;
- Return<void> notify_3_8(const hidl_vec<V3_8::NotifyMsg>& msgs) override;
- Return<void> requestStreamBuffers(
- const hidl_vec<V3_5::BufferRequest>& bufReqs,
- requestStreamBuffers_cb _hidl_cb) override;
+ Return<void> requestStreamBuffers(const hidl_vec<V3_5::BufferRequest>& bufReqs,
+ requestStreamBuffers_cb _hidl_cb) override;
Return<void> returnStreamBuffers(const hidl_vec<StreamBuffer>& buffers) override;
void setCurrentStreamConfig(const hidl_vec<V3_4::Stream>& streams,
- const hidl_vec<V3_2::HalStream>& halStreams);
+ const hidl_vec<V3_2::HalStream>& halStreams);
void waitForBuffersReturned();
private:
bool processCaptureResultLocked(const CaptureResult& results,
- hidl_vec<PhysicalCameraMetadata> physicalCameraMetadata);
+ hidl_vec<PhysicalCameraMetadata> physicalCameraMetadata);
Return<void> notifyHelper(const hidl_vec<NotifyMsg>& msgs,
- const std::vector<std::pair<bool, nsecs_t>>& readoutTimestamps);
+ const std::vector<std::pair<bool, nsecs_t>>& readoutTimestamps);
- CameraHidlTest *mParent; // Parent object
+ CameraHidlTest* mParent; // Parent object
int mDeviceVersion;
android::hardware::camera::common::V1_0::helper::CameraMetadata mStaticMetadata;
bool hasOutstandingBuffersLocked();
/* members for requestStreamBuffers() and returnStreamBuffers()*/
- std::mutex mLock; // protecting members below
- bool mUseHalBufManager = false;
- hidl_vec<V3_4::Stream> mStreams;
+ std::mutex mLock; // protecting members below
+ bool mUseHalBufManager = false;
+ hidl_vec<V3_4::Stream> mStreams;
hidl_vec<V3_2::HalStream> mHalStreams;
uint64_t mNextBufferId = 1;
using OutstandingBuffers = std::unordered_map<uint64_t, hidl_handle>;
@@ -814,20 +797,18 @@
sp<provider::V2_5::ICameraProvider>* provider2_5 /*out*/,
sp<provider::V2_6::ICameraProvider>* provider2_6 /*out*/,
sp<provider::V2_7::ICameraProvider>* provider2_7 /*out*/);
- void castSession(const sp<ICameraDeviceSession> &session, int32_t deviceVersion,
- sp<device::V3_3::ICameraDeviceSession> *session3_3 /*out*/,
- sp<device::V3_4::ICameraDeviceSession> *session3_4 /*out*/,
- sp<device::V3_5::ICameraDeviceSession> *session3_5 /*out*/,
- sp<device::V3_6::ICameraDeviceSession> *session3_6 /*out*/,
- sp<device::V3_7::ICameraDeviceSession> *session3_7 /*out*/,
- sp<device::V3_8::ICameraDeviceSession> *session3_8 /*out*/);
+ void castSession(const sp<ICameraDeviceSession>& session, int32_t deviceVersion,
+ sp<device::V3_3::ICameraDeviceSession>* session3_3 /*out*/,
+ sp<device::V3_4::ICameraDeviceSession>* session3_4 /*out*/,
+ sp<device::V3_5::ICameraDeviceSession>* session3_5 /*out*/,
+ sp<device::V3_6::ICameraDeviceSession>* session3_6 /*out*/,
+ sp<device::V3_7::ICameraDeviceSession>* session3_7 /*out*/);
void castInjectionSession(
const sp<ICameraDeviceSession>& session,
sp<device::V3_7::ICameraInjectionSession>* injectionSession3_7 /*out*/);
void castDevice(const sp<device::V3_2::ICameraDevice>& device, int32_t deviceVersion,
sp<device::V3_5::ICameraDevice>* device3_5 /*out*/,
- sp<device::V3_7::ICameraDevice>* device3_7 /*out*/,
- sp<device::V3_8::ICameraDevice>* device3_8 /*out*/);
+ sp<device::V3_7::ICameraDevice>* device3_7 /*out*/);
void createStreamConfiguration(
const ::android::hardware::hidl_vec<V3_2::Stream>& streams3_2,
StreamConfigurationMode configMode,
@@ -857,16 +838,6 @@
uint32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/,
sp<DeviceCb>* outCb /*out*/, uint32_t streamConfigCounter,
bool maxResolution);
- void configureStreams3_8(const std::string& name, int32_t deviceVersion,
- sp<ICameraProvider> provider, PixelFormat format,
- sp<device::V3_8::ICameraDeviceSession>* session3_8 /*out*/,
- V3_2::Stream* previewStream /*out*/,
- device::V3_6::HalStreamConfiguration* halStreamConfig /*out*/,
- bool* supportsPartialResults /*out*/,
- uint32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/,
- sp<DeviceCb>* outCb /*out*/, uint32_t streamConfigCounter,
- bool maxResolution,
- CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap prof);
void configurePreviewStreams3_4(const std::string &name, int32_t deviceVersion,
sp<ICameraProvider> provider,
@@ -947,9 +918,6 @@
static bool isDepthOnly(const camera_metadata_t* staticMeta);
static bool isUltraHighResolution(const camera_metadata_t* staticMeta);
- static void get10BitDynamicRangeProfiles(const camera_metadata_t* staticMeta,
- std::vector<CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap> *profiles);
- static bool is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta);
static Status getAvailableOutputStreams(const camera_metadata_t* staticMeta,
std::vector<AvailableStream>& outputStreams,
@@ -1130,10 +1098,6 @@
expectedPhysicalResults(extraPhysicalResult) {}
};
- static void verify10BitMetadata(HandleImporter& importer,
- const InFlightRequest& request,
- CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap profile);
-
// Map from frame number to the in-flight request state
typedef ::android::KeyedVector<uint32_t, InFlightRequest*> InFlightMap;
@@ -1564,32 +1528,6 @@
}
}
-Return<void> CameraHidlTest::DeviceCb::notify_3_8(
- const hidl_vec<V3_8::NotifyMsg>& msgs) {
- hidl_vec<NotifyMsg> msgs3_2;
- std::vector<std::pair<bool, nsecs_t>> readoutTimestamps;
-
- nsecs_t count = msgs.size();
- msgs3_2.resize(count);
- readoutTimestamps.resize(count);
-
- for (size_t i = 0; i < count; i++) {
- msgs3_2[i].type = msgs[i].type;
- switch (msgs[i].type) {
- case MsgType::ERROR:
- msgs3_2[i].msg.error = msgs[i].msg.error;
- readoutTimestamps[i] = {false, 0};
- break;
- case MsgType::SHUTTER:
- msgs3_2[i].msg.shutter = msgs[i].msg.shutter.v3_2;
- readoutTimestamps[i] = {true, msgs[i].msg.shutter.readoutTimestamp};
- break;
- }
- }
-
- return notifyHelper(msgs3_2, readoutTimestamps);
-}
-
Return<void> CameraHidlTest::DeviceCb::notify(
const hidl_vec<NotifyMsg>& messages) {
std::vector<std::pair<bool, nsecs_t>> readoutTimestamps;
@@ -2082,7 +2020,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -2127,7 +2064,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -2869,7 +2805,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -2957,7 +2892,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -3018,137 +2952,6 @@
}
}
-// Verify that the torch strength level can be set and retrieved successfully.
-TEST_P(CameraHidlTest, turnOnTorchWithStrengthLevel) {
- hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
- bool torchControlSupported = false;
- bool torchStrengthControlSupported = false;
- Return<void> ret;
-
- ret = mProvider->isSetTorchModeSupported([&](auto status, bool support) {
- ALOGI("isSetTorchModeSupported returns status:%d supported:%d", (int)status, support);
- ASSERT_EQ(Status::OK, status);
- torchControlSupported = support;
- });
-
- sp<TorchProviderCb> cb = new TorchProviderCb(this);
- Return<Status> returnStatus = mProvider->setCallback(cb);
- ASSERT_TRUE(returnStatus.isOk());
- ASSERT_EQ(Status::OK, returnStatus);
-
- for (const auto& name : cameraDeviceNames) {
- int deviceVersion = getCameraDeviceVersion(name, mProviderType);
- int32_t defaultLevel;
- switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8: {
- ::android::sp<::android::hardware::camera::device::V3_8::ICameraDevice> device3_8;
- ALOGI("%s: Testing camera device %s", __FUNCTION__, name.c_str());
- ret = mProvider->getCameraDeviceInterface_V3_x(
- name, [&](auto status, const auto& device) {
- ASSERT_EQ(Status::OK, status);
- ASSERT_NE(device, nullptr);
- auto castResult = device::V3_8::ICameraDevice::castFrom(device);
- ASSERT_TRUE(castResult.isOk());
- device3_8 = castResult;
- });
- ASSERT_TRUE(ret.isOk());
-
- ret = device3_8->getCameraCharacteristics([&] (auto s, const auto& chars) {
- ASSERT_EQ(Status::OK, s);
- const camera_metadata_t* staticMeta =
- reinterpret_cast<const camera_metadata_t*>(chars.data());
- ASSERT_NE(nullptr, staticMeta);
- torchStrengthControlSupported = isTorchStrengthControlSupported(staticMeta);
- camera_metadata_ro_entry entry;
- int rc = find_camera_metadata_ro_entry(staticMeta,
- ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, &entry);
- if (torchStrengthControlSupported) {
- ASSERT_EQ(rc, 0);
- ASSERT_GT(entry.count, 0);
- defaultLevel = *entry.data.i32;
- ALOGI("Default level is:%d", defaultLevel);
- }
- });
- ASSERT_TRUE(ret.isOk());
- // If torchStrengthControl is supported, torchControlSupported should be true.
- if (torchStrengthControlSupported) {
- ASSERT_TRUE(torchControlSupported);
- }
- mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
- returnStatus = device3_8->turnOnTorchWithStrengthLevel(2);
- ASSERT_TRUE(returnStatus.isOk());
- // Method_not_supported check
- if (!torchStrengthControlSupported) {
- ALOGI("Torch strength control not supported.");
- ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus);
- } else {
- ASSERT_EQ(Status::OK, returnStatus);
- if (returnStatus == Status::OK) {
- {
- std::unique_lock<std::mutex> l(mTorchLock);
- while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
- auto timeout = std::chrono::system_clock::now() +
- std::chrono::seconds(kTorchTimeoutSec);
- ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l,
- timeout));
- }
- ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus);
- mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
- }
- ALOGI("getTorchStrengthLevel: Testing");
- ret = device3_8->getTorchStrengthLevel([&]
- (auto status, const auto& strengthLevel) {
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Status::OK, status);
- ALOGI("Torch strength level is : %d", strengthLevel);
- ASSERT_EQ(strengthLevel, 2);
- });
- // Turn OFF the torch and verify torch strength level is reset to default level.
- ALOGI("Testing torch strength level reset after turning the torch OFF.");
- returnStatus = device3_8->setTorchMode(TorchMode::OFF);
- ASSERT_TRUE(returnStatus.isOk());
- ASSERT_EQ(Status::OK, returnStatus);
- {
- std::unique_lock<std::mutex> l(mTorchLock);
- while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
- auto timeout = std::chrono::system_clock::now() +
- std::chrono::seconds(kTorchTimeoutSec);
- ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l,
- timeout));
- }
- ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus);
- }
- ret = device3_8->getTorchStrengthLevel([&]
- (auto status, const auto& strengthLevel) {
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Status::OK, status);
- ALOGI("Torch strength level after turning OFF torch is : %d",
- strengthLevel);
- ASSERT_EQ(strengthLevel, defaultLevel);
- });
- }
- }
- }
- break;
- case CAMERA_DEVICE_API_VERSION_3_7:
- case CAMERA_DEVICE_API_VERSION_3_6:
- case CAMERA_DEVICE_API_VERSION_3_5:
- case CAMERA_DEVICE_API_VERSION_3_4:
- case CAMERA_DEVICE_API_VERSION_3_3:
- case CAMERA_DEVICE_API_VERSION_3_2:
- case CAMERA_DEVICE_API_VERSION_1_0: {
- ALOGI("Torch strength control feature not supported.");
- }
- break;
- default: {
- ALOGI("Invalid device version.");
- ADD_FAILURE();
- }
- break;
- }
- }
-}
-
//In case it is supported verify that torch can be enabled.
//Check for corresponding toch callbacks as well.
TEST_P(CameraHidlTest, setTorchMode) {
@@ -3170,7 +2973,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -3299,7 +3101,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -3367,7 +3168,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -3401,13 +3201,10 @@
sp<device::V3_5::ICameraDeviceSession> sessionV3_5;
sp<device::V3_6::ICameraDeviceSession> sessionV3_6;
sp<device::V3_7::ICameraDeviceSession> sessionV3_7;
- sp<device::V3_8::ICameraDeviceSession> sessionV3_8;
- castSession(session, deviceVersion, &sessionV3_3,
- &sessionV3_4, &sessionV3_5, &sessionV3_6,
- &sessionV3_7, &sessionV3_8);
- if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_8) {
- ASSERT_TRUE(sessionV3_8.get() != nullptr);
- } else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_7) {
+ castSession(session, deviceVersion, &sessionV3_3, &sessionV3_4, &sessionV3_5,
+ &sessionV3_6, &sessionV3_7);
+
+ if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_7) {
ASSERT_TRUE(sessionV3_7.get() != nullptr);
} else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_6) {
ASSERT_TRUE(sessionV3_6.get() != nullptr);
@@ -3417,7 +3214,7 @@
ASSERT_TRUE(sessionV3_4.get() != nullptr);
} else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_3) {
ASSERT_TRUE(sessionV3_3.get() != nullptr);
- } else { //V3_2
+ } else { // V3_2
ASSERT_TRUE(sessionV3_3.get() == nullptr);
ASSERT_TRUE(sessionV3_4.get() == nullptr);
ASSERT_TRUE(sessionV3_5.get() == nullptr);
@@ -3473,7 +3270,6 @@
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8:
case CAMERA_DEVICE_API_VERSION_3_7:
case CAMERA_DEVICE_API_VERSION_3_6:
case CAMERA_DEVICE_API_VERSION_3_5:
@@ -3575,17 +3371,14 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
openEmptyDeviceSession(name, mProvider,
&session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
outputStreams.clear();
ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams));
@@ -3681,11 +3474,9 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
::android::hardware::camera::device::V3_7::StreamConfiguration config3_7;
::android::hardware::camera::device::V3_5::StreamConfiguration config3_5;
::android::hardware::camera::device::V3_4::StreamConfiguration config3_4;
@@ -3722,9 +3513,8 @@
openEmptyDeviceSession(name, mProvider2_6, &cti.session /*out*/,
&cti.staticMeta /*out*/, &cti.cameraDevice /*out*/);
castSession(cti.session, deviceVersion, &cti.session3_3, &cti.session3_4,
- &cti.session3_5, &cti.session3_6, &cti.session3_7, &cti.session3_8);
- castDevice(cti.cameraDevice, deviceVersion, &cti.cameraDevice3_5, &cti.cameraDevice3_7,
- &cti.cameraDevice3_8);
+ &cti.session3_5, &cti.session3_6, &cti.session3_7);
+ castDevice(cti.cameraDevice, deviceVersion, &cti.cameraDevice3_5, &cti.cameraDevice3_7);
outputStreams.clear();
ASSERT_EQ(Status::OK, getMandatoryConcurrentStreams(cti.staticMeta, &outputStreams));
@@ -3853,17 +3643,14 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
&cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
outputStreams.clear();
ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams));
@@ -4069,17 +3856,14 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
&cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
Status rc = isZSLModeAvailable(staticMeta);
if (Status::METHOD_NOT_SUPPORTED == rc) {
@@ -4258,10 +4042,9 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMetaBuffer /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_4) {
ASSERT_NE(session3_4, nullptr);
} else {
@@ -4400,17 +4183,14 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
&cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
// Check if camera support depth only
if (isDepthOnly(staticMeta)) {
@@ -4537,17 +4317,14 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
&cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
Status rc = isConstrainedModeAvailable(staticMeta);
if (Status::METHOD_NOT_SUPPORTED == rc) {
@@ -4820,17 +4597,14 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
sp<device::V3_2::ICameraDevice> cameraDevice;
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
&cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
+ castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
// Check if camera support depth only
if (isDepthOnly(staticMeta)) {
@@ -5069,28 +4843,6 @@
ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId);
- // For camera device 3.8 or newer, shutterReadoutTimestamp must be
- // available, and it must be >= shutterTimestamp + exposureTime, and
- // < shutterTimestamp + exposureTime + rollingShutterSkew / 2.
- if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8) {
- ASSERT_TRUE(inflightReq.shutterReadoutTimestampValid);
- ASSERT_FALSE(inflightReq.collectedResult.isEmpty());
- if (inflightReq.collectedResult.exists(ANDROID_SENSOR_EXPOSURE_TIME)) {
- camera_metadata_entry_t exposureTimeResult = inflightReq.collectedResult.find(
- ANDROID_SENSOR_EXPOSURE_TIME);
- nsecs_t exposureToReadout =
- inflightReq.shutterReadoutTimestamp - inflightReq.shutterTimestamp;
- ASSERT_GE(exposureToReadout, exposureTimeResult.data.i64[0]);
- if (inflightReq.collectedResult.exists(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW)) {
- camera_metadata_entry_t rollingShutterSkew =
- inflightReq.collectedResult.find(
- ANDROID_SENSOR_ROLLING_SHUTTER_SKEW);
- ASSERT_LT(exposureToReadout, exposureTimeResult.data.i64[0] +
- rollingShutterSkew.data.i64[0] / 2);
- }
- }
- }
-
request.frameNumber++;
// Empty settings should be supported after the first call
// for repeating requests.
@@ -5114,20 +4866,6 @@
ASSERT_EQ(Status::OK, status);
ASSERT_EQ(numRequestProcessed, 1u);
- if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8) {
- sp<device::V3_3::ICameraDeviceSession> session3_3;
- sp<device::V3_4::ICameraDeviceSession> session3_4;
- sp<device::V3_5::ICameraDeviceSession> session3_5;
- sp<device::V3_6::ICameraDeviceSession> session3_6;
- sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- ASSERT_TRUE(session3_8.get() != nullptr);
- hidl_vec<int32_t> streamIds = { halStreamConfig.streams[0].id };
- session3_8->repeatingRequestEnd(request.frameNumber, streamIds);
- }
-
{
std::unique_lock<std::mutex> l(mLock);
while (!inflightReq.errorCodeValid &&
@@ -5153,196 +4891,6 @@
}
}
-TEST_P(CameraHidlTest, processCaptureRequestPreviewStabilization) {
- std::unordered_map<std::string, nsecs_t> cameraDeviceToTimeLag;
- processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ false,
- cameraDeviceToTimeLag);
- processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ true,
- cameraDeviceToTimeLag);
-}
-
-void CameraHidlTest::processPreviewStabilizationCaptureRequestInternal(
- bool previewStabilizationOn,
- // Used as output when preview stabilization is off, as output when its
- // on.
- std::unordered_map<std::string, nsecs_t>& cameraDeviceToTimeLag) {
- hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
- AvailableStream streamThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
- static_cast<int32_t>(PixelFormat::IMPLEMENTATION_DEFINED)};
- uint64_t bufferId = 1;
- uint32_t frameNumber = 1;
- ::android::hardware::hidl_vec<uint8_t> settings;
-
- for (const auto& name : cameraDeviceNames) {
- int deviceVersion = getCameraDeviceVersion(name, mProviderType);
- if (deviceVersion == CAMERA_DEVICE_API_VERSION_1_0) {
- continue;
- } else if (deviceVersion <= 0) {
- ALOGE("%s: Unsupported device version %d", __func__, deviceVersion);
- ADD_FAILURE();
- return;
- }
-
- if (!supportsPreviewStabilization(name, mProvider)) {
- ALOGI(" %s Camera device %s doesn't support preview stabilization, skipping", __func__,
- name.c_str());
- continue;
- }
-
- if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) {
- ALOGE("%s: device version < 3.8 must not advertise preview stabilization,"
- " camera metadata validation will fail",
- __func__);
- ADD_FAILURE();
- }
-
- V3_2::Stream testStream;
- HalStreamConfiguration halStreamConfig;
- sp<ICameraDeviceSession> session;
- sp<DeviceCb> cb;
- bool supportsPartialResults = false;
- bool useHalBufManager = false;
- uint32_t partialResultCount = 0;
- configureSingleStream(name, deviceVersion, mProvider, &streamThreshold,
- GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, RequestTemplate::PREVIEW,
- &session /*out*/, &testStream /*out*/, &halStreamConfig /*out*/,
- &supportsPartialResults /*out*/, &partialResultCount /*out*/,
- &useHalBufManager /*out*/, &cb /*out*/);
-
- std::shared_ptr<ResultMetadataQueue> resultQueue;
- auto resultQueueRet =
- session->getCaptureResultMetadataQueue([&resultQueue](const auto& descriptor) {
- resultQueue = std::make_shared<ResultMetadataQueue>(descriptor);
- if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) {
- ALOGE("%s: HAL returns empty result metadata fmq,"
- " not use it",
- __func__);
- resultQueue = nullptr;
- // Don't use the queue onwards.
- }
- });
- ASSERT_TRUE(resultQueueRet.isOk());
-
- InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount,
- resultQueue};
-
- Return<void> ret;
- android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings;
- ret = session->constructDefaultRequestSettings(
- RequestTemplate::PREVIEW, [&](auto status, const auto& req) {
- ASSERT_EQ(Status::OK, status);
- const camera_metadata_t* metadata =
- reinterpret_cast<const camera_metadata_t*>(req.data());
- defaultSettings = metadata;
- settings = req;
- });
- ASSERT_TRUE(ret.isOk());
- android::status_t metadataRet = ::android::OK;
- uint8_t videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF;
- if (previewStabilizationOn) {
- videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION;
- metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE,
- &videoStabilizationMode, 1);
- } else {
- metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE,
- &videoStabilizationMode, 1);
- }
- ASSERT_EQ(metadataRet, ::android::OK);
- hidl_handle buffer_handle;
- StreamBuffer outputBuffer;
- if (useHalBufManager) {
- outputBuffer = {halStreamConfig.streams[0].id,
- /*bufferId*/ 0,
- buffer_handle,
- BufferStatus::OK,
- nullptr,
- nullptr};
- } else {
- allocateGraphicBuffer(
- testStream.width, testStream.height,
- /* We don't look at halStreamConfig.streams[0].consumerUsage
- * since that is 0 for output streams
- */
- android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage,
- GRALLOC1_CONSUMER_USAGE_HWCOMPOSER),
- halStreamConfig.streams[0].overrideFormat, &buffer_handle);
- outputBuffer = {halStreamConfig.streams[0].id,
- bufferId,
- buffer_handle,
- BufferStatus::OK,
- nullptr,
- nullptr};
- }
- ::android::hardware::hidl_vec<StreamBuffer> outputBuffers = {outputBuffer};
- StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr};
- CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings, emptyInputBuffer,
- outputBuffers};
-
- {
- std::unique_lock<std::mutex> l(mLock);
- mInflightMap.clear();
- mInflightMap.add(frameNumber, &inflightReq);
- }
-
- Status status = Status::INTERNAL_ERROR;
- uint32_t numRequestProcessed = 0;
- hidl_vec<BufferCache> cachesToRemove;
- Return<void> returnStatus = session->processCaptureRequest(
- {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) {
- status = s;
- numRequestProcessed = n;
- });
- ASSERT_TRUE(returnStatus.isOk());
- ASSERT_EQ(Status::OK, status);
- ASSERT_EQ(numRequestProcessed, 1u);
-
- {
- std::unique_lock<std::mutex> l(mLock);
- while (!inflightReq.errorCodeValid &&
- ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) {
- auto timeout = std::chrono::system_clock::now() +
- std::chrono::seconds(kStreamBufferTimeoutSec);
- ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
- }
-
- ASSERT_FALSE(inflightReq.errorCodeValid);
- ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
- ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId);
- ASSERT_TRUE(inflightReq.shutterReadoutTimestampValid);
- nsecs_t readoutTimestamp = inflightReq.shutterReadoutTimestamp;
-
- if (previewStabilizationOn) {
- // Here we collect the time difference between the buffer ready
- // timestamp - notify readout timestamp.
- // timeLag = buffer ready timestamp - notify readout timestamp.
- // timeLag(previewStabilization) must be <=
- // timeLag(stabilization off) + 1 frame duration.
- auto it = cameraDeviceToTimeLag.find(name.c_str());
- camera_metadata_entry e;
- e = inflightReq.collectedResult.find(ANDROID_SENSOR_FRAME_DURATION);
- ASSERT_TRUE(e.count > 0);
- nsecs_t frameDuration = e.data.i64[0];
- ASSERT_TRUE(it != cameraDeviceToTimeLag.end());
-
- nsecs_t previewStabOnLagTime =
- inflightReq.resultOutputBuffers[0].timeStamp - readoutTimestamp;
- ASSERT_TRUE(previewStabOnLagTime <= (it->second + frameDuration));
- } else {
- // Fill in the buffer ready timestamp - notify timestamp;
- cameraDeviceToTimeLag[std::string(name.c_str())] =
- inflightReq.resultOutputBuffers[0].timeStamp - readoutTimestamp;
- }
- }
-
- if (useHalBufManager) {
- verifyBuffersReturned(session, deviceVersion, testStream.id, cb);
- }
-
- ret = session->close();
- ASSERT_TRUE(ret.isOk());
- }
-}
-
// Generate and verify a multi-camera capture request
TEST_P(CameraHidlTest, processMultiCaptureRequestPreview) {
hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
@@ -5771,188 +5319,6 @@
}
}
-// Generate and verify 10-bit dynamic range request
-TEST_P(CameraHidlTest, process10BitDynamicRangeRequest) {
- hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
- uint64_t bufferId = 1;
- uint32_t frameNumber = 1;
- ::android::hardware::hidl_vec<uint8_t> settings;
-
- for (const auto& name : cameraDeviceNames) {
- int deviceVersion = getCameraDeviceVersion(name, mProviderType);
- if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) {
- continue;
- }
- std::string version, deviceId;
- ASSERT_TRUE(::matchDeviceName(name, mProviderType, &version, &deviceId));
- camera_metadata_t* staticMeta;
- Return<void> ret;
- sp<ICameraDeviceSession> session;
- openEmptyDeviceSession(name, mProvider, &session, &staticMeta);
- if (!is10BitDynamicRangeCapable(staticMeta)) {
- free_camera_metadata(staticMeta);
- ret = session->close();
- ASSERT_TRUE(ret.isOk());
- continue;
- }
- std::vector<CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap> profileList;
- get10BitDynamicRangeProfiles(staticMeta, &profileList);
- ASSERT_FALSE(profileList.empty());
-
- android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings;
- ret = session->constructDefaultRequestSettings(
- RequestTemplate::STILL_CAPTURE,
- [&defaultSettings](auto status, const auto& req) mutable {
- ASSERT_EQ(Status::OK, status);
-
- const camera_metadata_t* metadata =
- reinterpret_cast<const camera_metadata_t*>(req.data());
- size_t expectedSize = req.size();
- int result = validate_camera_metadata_structure(metadata, &expectedSize);
- ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
-
- size_t entryCount = get_camera_metadata_entry_count(metadata);
- ASSERT_GT(entryCount, 0u);
- defaultSettings = metadata;
- });
- ASSERT_TRUE(ret.isOk());
-
- const camera_metadata_t* settingsBuffer = defaultSettings.getAndLock();
- settings.setToExternal(
- reinterpret_cast<uint8_t*>(const_cast<camera_metadata_t*>(settingsBuffer)),
- get_camera_metadata_size(settingsBuffer));
- overrideRotateAndCrop(&settings);
-
- free_camera_metadata(staticMeta);
- ret = session->close();
- ASSERT_TRUE(ret.isOk());
- V3_6::HalStreamConfiguration halStreamConfig;
- bool supportsPartialResults = false;
- bool useHalBufManager = false;
- uint32_t partialResultCount = 0;
- V3_2::Stream previewStream;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
- sp<DeviceCb> cb;
- for (const auto& profile : profileList) {
- configureStreams3_8(name, deviceVersion, mProvider, PixelFormat::IMPLEMENTATION_DEFINED,
- &session3_8, &previewStream, &halStreamConfig,
- &supportsPartialResults, &partialResultCount, &useHalBufManager,
- &cb, 0, /*maxResolution*/ false, profile);
- ASSERT_NE(session3_8, nullptr);
-
- std::shared_ptr<ResultMetadataQueue> resultQueue;
- auto resultQueueRet = session3_8->getCaptureResultMetadataQueue(
- [&resultQueue](const auto& descriptor) {
- resultQueue = std::make_shared<ResultMetadataQueue>(descriptor);
- if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) {
- ALOGE("%s: HAL returns empty result metadata fmq,"
- " not use it",
- __func__);
- resultQueue = nullptr;
- // Don't use the queue onwards.
- }
- });
- ASSERT_TRUE(resultQueueRet.isOk());
-
- std::vector<hidl_handle> graphicBuffers;
- graphicBuffers.reserve(halStreamConfig.streams.size());
- ::android::hardware::hidl_vec<StreamBuffer> outputBuffers;
- outputBuffers.resize(halStreamConfig.streams.size());
- InFlightRequest inflightReq = {static_cast<ssize_t>(halStreamConfig.streams.size()),
- false,
- supportsPartialResults,
- partialResultCount,
- std::unordered_set<std::string>(),
- resultQueue};
-
- size_t k = 0;
- for (const auto& halStream : halStreamConfig.streams) {
- hidl_handle buffer_handle;
- if (useHalBufManager) {
- outputBuffers[k] = {halStream.v3_4.v3_3.v3_2.id,
- 0,
- buffer_handle,
- BufferStatus::OK,
- nullptr,
- nullptr};
- } else {
- allocateGraphicBuffer(
- previewStream.width, previewStream.height,
- android_convertGralloc1To0Usage(halStream.v3_4.v3_3.v3_2.producerUsage,
- halStream.v3_4.v3_3.v3_2.consumerUsage),
- halStream.v3_4.v3_3.v3_2.overrideFormat, &buffer_handle);
-
- graphicBuffers.push_back(buffer_handle);
- outputBuffers[k] = {halStream.v3_4.v3_3.v3_2.id,
- bufferId,
- buffer_handle,
- BufferStatus::OK,
- nullptr,
- nullptr};
- bufferId++;
- }
- k++;
- }
-
- StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr};
- V3_4::CaptureRequest request3_4;
- request3_4.v3_2.frameNumber = frameNumber;
- request3_4.v3_2.fmqSettingsSize = 0;
- request3_4.v3_2.settings = settings;
- request3_4.v3_2.inputBuffer = emptyInputBuffer;
- request3_4.v3_2.outputBuffers = outputBuffers;
- V3_7::CaptureRequest request3_7;
- request3_7.v3_4 = request3_4;
- request3_7.inputWidth = 0;
- request3_7.inputHeight = 0;
-
- {
- std::unique_lock<std::mutex> l(mLock);
- mInflightMap.clear();
- mInflightMap.add(frameNumber, &inflightReq);
- }
-
- Status stat = Status::INTERNAL_ERROR;
- uint32_t numRequestProcessed = 0;
- hidl_vec<BufferCache> cachesToRemove;
- Return<void> returnStatus = session3_8->processCaptureRequest_3_7(
- {request3_7}, cachesToRemove,
- [&stat, &numRequestProcessed](auto s, uint32_t n) {
- stat = s;
- numRequestProcessed = n;
- });
- ASSERT_TRUE(returnStatus.isOk());
- ASSERT_EQ(Status::OK, stat);
- ASSERT_EQ(numRequestProcessed, 1u);
-
- {
- std::unique_lock<std::mutex> l(mLock);
- while (!inflightReq.errorCodeValid &&
- ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) {
- auto timeout = std::chrono::system_clock::now() +
- std::chrono::seconds(kStreamBufferTimeoutSec);
- ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
- }
-
- ASSERT_FALSE(inflightReq.errorCodeValid);
- ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
- verify10BitMetadata(mHandleImporter, inflightReq, profile);
- }
- if (useHalBufManager) {
- hidl_vec<int32_t> streamIds(halStreamConfig.streams.size());
- for (size_t i = 0; i < streamIds.size(); i++) {
- streamIds[i] = halStreamConfig.streams[i].v3_4.v3_3.v3_2.id;
- }
- session3_8->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0);
- cb->waitForBuffersReturned();
- }
-
- ret = session3_8->close();
- ASSERT_TRUE(ret.isOk());
- }
- }
-}
-
// Generate and verify a burst containing alternating sensor sensitivity values
TEST_P(CameraHidlTest, processCaptureRequestBurstISO) {
hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
@@ -5982,8 +5348,8 @@
camera_metadata_entry_t hwLevel = staticMeta.find(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL);
ASSERT_TRUE(0 < hwLevel.count);
if (ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED == hwLevel.data.u8[0] ||
- ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL == hwLevel.data.u8[0]) {
- //Limited/External devices can skip this test
+ ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL == hwLevel.data.u8[0]) {
+ // Limited/External devices can skip this test
ret = session->close();
ASSERT_TRUE(ret.isOk());
continue;
@@ -6946,134 +6312,6 @@
}
}
-// Verify that valid stream use cases can be configured successfully, and invalid use cases
-// fail stream configuration.
-TEST_P(CameraHidlTest, configureStreamsUseCases) {
- hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
-
- for (const auto& name : cameraDeviceNames) {
- int deviceVersion = getCameraDeviceVersion(name, mProviderType);
- if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) {
- continue;
- }
-
- camera_metadata_t* staticMeta;
- Return<void> ret;
- sp<ICameraDeviceSession> session;
- sp<device::V3_3::ICameraDeviceSession> session3_3;
- sp<device::V3_4::ICameraDeviceSession> session3_4;
- sp<device::V3_5::ICameraDeviceSession> session3_5;
- sp<device::V3_6::ICameraDeviceSession> session3_6;
- sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
- sp<device::V3_2::ICameraDevice> cameraDevice;
- sp<device::V3_5::ICameraDevice> cameraDevice3_5;
- sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
- openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/,
- &cameraDevice /*out*/);
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
- ASSERT_NE(nullptr, session3_8);
- castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7,
- &cameraDevice3_8);
- ASSERT_NE(nullptr, cameraDevice3_8);
-
- // Check if camera support depth only
- if (isDepthOnly(staticMeta)) {
- free_camera_metadata(staticMeta);
- ret = session->close();
- ASSERT_TRUE(ret.isOk());
- continue;
- }
-
- std::vector<AvailableStream> outputPreviewStreams;
- AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
- static_cast<int32_t>(PixelFormat::YCBCR_420_888)};
- ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputPreviewStreams,
- &previewThreshold));
- ASSERT_NE(0u, outputPreviewStreams.size());
-
- // Combine valid and invalid stream use cases
- std::vector<int64_t> useCases(kMandatoryUseCases);
- useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1);
-
- std::vector<int64_t> supportedUseCases;
- camera_metadata_ro_entry entry;
- auto retcode = find_camera_metadata_ro_entry(staticMeta,
- ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry);
- if ((0 == retcode) && (entry.count > 0)) {
- supportedUseCases.insert(supportedUseCases.end(), entry.data.i64,
- entry.data.i64 + entry.count);
- } else {
- supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT);
- }
- free_camera_metadata(staticMeta);
-
- ::android::hardware::hidl_vec<V3_8::Stream> streams3_8(1);
- streams3_8[0].v3_7.groupId = -1;
- streams3_8[0].v3_7.sensorPixelModesUsed = {
- CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT};
- streams3_8[0].v3_7.v3_4.bufferSize = 0;
- streams3_8[0].v3_7.v3_4.v3_2.id = 0;
- streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT;
- streams3_8[0].v3_7.v3_4.v3_2.width = static_cast<uint32_t>(outputPreviewStreams[0].width);
- streams3_8[0].v3_7.v3_4.v3_2.height = static_cast<uint32_t>(outputPreviewStreams[0].height);
- streams3_8[0].v3_7.v3_4.v3_2.format =
- static_cast<PixelFormat>(outputPreviewStreams[0].format);
- streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ;
- streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0;
- streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0;
- streams3_8[0].dynamicRangeProfile =
- static_cast<CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap>(
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD);
-
- uint32_t streamConfigCounter = 0;
- ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8;
- RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE;
- ret = session3_8->constructDefaultRequestSettings(reqTemplate,
- [&config3_8](auto status, const auto& req) {
- ASSERT_EQ(Status::OK, status);
- config3_8.sessionParams = req;
- });
- ASSERT_TRUE(ret.isOk());
-
- for (int64_t useCase : useCases) {
- bool useCaseSupported = std::find(supportedUseCases.begin(),
- supportedUseCases.end(), useCase) != supportedUseCases.end();
-
- streams3_8[0].useCase =
- static_cast<CameraMetadataEnumAndroidScalerAvailableStreamUseCases>(useCase);
- config3_8.streams = streams3_8;
- config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE;
- config3_8.streamConfigCounter = streamConfigCounter;
- config3_8.multiResolutionInputImage = false;
- ret = cameraDevice3_8->isStreamCombinationSupported_3_8(
- config3_8, [&useCaseSupported](Status s, bool combStatus) {
- ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s));
- if (Status::OK == s) {
- ASSERT_EQ(combStatus, useCaseSupported);
- }
- });
- ASSERT_TRUE(ret.isOk());
-
- ret = session3_8->configureStreams_3_8(
- config3_8,
- [&](Status s, device::V3_6::HalStreamConfiguration halConfig) {
- if (useCaseSupported) {
- ASSERT_EQ(Status::OK, s);
- ASSERT_EQ(1u, halConfig.streams.size());
- } else {
- ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s);
- }
- });
- ASSERT_TRUE(ret.isOk());
- }
- ret = session3_8->close();
- ASSERT_TRUE(ret.isOk());
- }
-}
-
// Retrieve all valid output stream resolutions from the camera
// static characteristics.
Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta,
@@ -7736,9 +6974,8 @@
sp<device::V3_4::ICameraDeviceSession> session3_4;
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
- session3_7, &session3_8);
+ session3_7);
ASSERT_NE(nullptr, (*session3_7).get());
*useHalBufManager = false;
@@ -7786,8 +7023,7 @@
ASSERT_TRUE(deviceVersion >= CAMERA_DEVICE_API_VERSION_3_7);
sp<device::V3_5::ICameraDevice> cameraDevice3_5 = nullptr;
sp<device::V3_7::ICameraDevice> cameraDevice3_7 = nullptr;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8 = nullptr;
- castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8);
+ castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
ASSERT_NE(cameraDevice3_7, nullptr);
bool supported = false;
ret = cameraDevice3_7->isStreamCombinationSupported_3_7(
@@ -7820,153 +7056,6 @@
ASSERT_TRUE(ret.isOk());
}
-// Configure streams
-void CameraHidlTest::configureStreams3_8(
- const std::string& name, int32_t deviceVersion, sp<ICameraProvider> provider,
- PixelFormat format, sp<device::V3_8::ICameraDeviceSession>* session3_8 /*out*/,
- V3_2::Stream* previewStream /*out*/,
- device::V3_6::HalStreamConfiguration* halStreamConfig /*out*/,
- bool* supportsPartialResults /*out*/, uint32_t* partialResultCount /*out*/,
- bool* useHalBufManager /*out*/, sp<DeviceCb>* outCb /*out*/, uint32_t streamConfigCounter,
- bool maxResolution,
- CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap prof) {
- ASSERT_NE(nullptr, session3_8);
- ASSERT_NE(nullptr, halStreamConfig);
- ASSERT_NE(nullptr, previewStream);
- ASSERT_NE(nullptr, supportsPartialResults);
- ASSERT_NE(nullptr, partialResultCount);
- ASSERT_NE(nullptr, useHalBufManager);
- ASSERT_NE(nullptr, outCb);
- ASSERT_TRUE(deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8);
-
- std::vector<AvailableStream> outputStreams;
- ::android::sp<ICameraDevice> device3_x;
- ALOGI("configureStreams: Testing camera device %s", name.c_str());
- Return<void> ret;
- ret = provider->getCameraDeviceInterface_V3_x(name, [&](auto status, const auto& device) {
- ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
- ASSERT_EQ(Status::OK, status);
- ASSERT_NE(device, nullptr);
- device3_x = device;
- });
- ASSERT_TRUE(ret.isOk());
-
- camera_metadata_t* staticMeta;
- ret = device3_x->getCameraCharacteristics([&](Status s, CameraMetadata metadata) {
- ASSERT_EQ(Status::OK, s);
- staticMeta =
- clone_camera_metadata(reinterpret_cast<const camera_metadata_t*>(metadata.data()));
- ASSERT_NE(nullptr, staticMeta);
- });
- ASSERT_TRUE(ret.isOk());
-
- camera_metadata_ro_entry entry;
- auto status =
- find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry);
- if ((0 == status) && (entry.count > 0)) {
- *partialResultCount = entry.data.i32[0];
- *supportsPartialResults = (*partialResultCount > 1);
- }
-
- sp<DeviceCb> cb = new DeviceCb(this, deviceVersion, staticMeta);
- sp<ICameraDeviceSession> session;
- ret = device3_x->open(cb, [&session](auto status, const auto& newSession) {
- ALOGI("device::open returns status:%d", (int)status);
- ASSERT_EQ(Status::OK, status);
- ASSERT_NE(newSession, nullptr);
- session = newSession;
- });
- ASSERT_TRUE(ret.isOk());
- *outCb = cb;
-
- sp<device::V3_3::ICameraDeviceSession> session3_3;
- sp<device::V3_4::ICameraDeviceSession> session3_4;
- sp<device::V3_5::ICameraDeviceSession> session3_5;
- sp<device::V3_6::ICameraDeviceSession> session3_6;
- sp<device::V3_7::ICameraDeviceSession> session3_7;
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
- &session3_7, session3_8);
- ASSERT_NE(nullptr, (*session3_8).get());
-
- *useHalBufManager = false;
- status = find_camera_metadata_ro_entry(
- staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
- if ((0 == status) && (entry.count == 1)) {
- *useHalBufManager = (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
- }
-
- outputStreams.clear();
- Size maxSize;
- auto rc = getMaxOutputSizeForFormat(staticMeta, format, &maxSize, maxResolution);
- ASSERT_EQ(Status::OK, rc);
- free_camera_metadata(staticMeta);
-
- ::android::hardware::hidl_vec<V3_8::Stream> streams3_8(1);
- streams3_8[0].v3_7.groupId = -1;
- streams3_8[0].v3_7.sensorPixelModesUsed = {
- CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT};
- streams3_8[0].v3_7.v3_4.bufferSize = 0;
- streams3_8[0].v3_7.v3_4.v3_2.id = 0;
- streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT;
- streams3_8[0].v3_7.v3_4.v3_2.width = static_cast<uint32_t>(maxSize.width);
- streams3_8[0].v3_7.v3_4.v3_2.height = static_cast<uint32_t>(maxSize.height);
- streams3_8[0].v3_7.v3_4.v3_2.format = static_cast<PixelFormat>(format);
- streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ;
- streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0;
- streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0;
- streams3_8[0].dynamicRangeProfile = prof;
-
- ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8;
- config3_8.streams = streams3_8;
- config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE;
- config3_8.streamConfigCounter = streamConfigCounter;
- config3_8.multiResolutionInputImage = false;
- RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE;
- ret = (*session3_8)
- ->constructDefaultRequestSettings(reqTemplate,
- [&config3_8](auto status, const auto& req) {
- ASSERT_EQ(Status::OK, status);
- config3_8.sessionParams = req;
- });
- ASSERT_TRUE(ret.isOk());
-
- sp<device::V3_5::ICameraDevice> cameraDevice3_5 = nullptr;
- sp<device::V3_7::ICameraDevice> cameraDevice3_7 = nullptr;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8 = nullptr;
- castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8);
- ASSERT_NE(cameraDevice3_8, nullptr);
- bool supported = false;
- ret = cameraDevice3_8->isStreamCombinationSupported_3_8(
- config3_8, [&supported](Status s, bool combStatus) {
- ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s));
- if (Status::OK == s) {
- supported = combStatus;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(supported, true);
-
- if (*session3_8 != nullptr) {
- ret = (*session3_8)
- ->configureStreams_3_8(
- config3_8,
- [&](Status s, device::V3_6::HalStreamConfiguration halConfig) {
- ASSERT_EQ(Status::OK, s);
- *halStreamConfig = halConfig;
- if (*useHalBufManager) {
- hidl_vec<V3_4::Stream> streams(1);
- hidl_vec<V3_2::HalStream> halStreams(1);
- streams[0] = streams3_8[0].v3_7.v3_4;
- halStreams[0] = halConfig.streams[0].v3_4.v3_3.v3_2;
- cb->setCurrentStreamConfig(streams, halStreams);
- }
- });
- }
- *previewStream = streams3_8[0].v3_7.v3_4.v3_2;
- ASSERT_TRUE(ret.isOk());
-}
-
// Configure multiple preview streams using different physical ids.
void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t deviceVersion,
sp<ICameraProvider> provider,
@@ -8041,9 +7130,8 @@
sp<device::V3_3::ICameraDeviceSession> session3_3;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
- castSession(session, deviceVersion, &session3_3, session3_4, session3_5,
- &session3_6, &session3_7, &session3_8);
+ castSession(session, deviceVersion, &session3_3, session3_4, session3_5, &session3_6,
+ &session3_7);
ASSERT_NE(nullptr, (*session3_4).get());
*useHalBufManager = false;
@@ -8088,8 +7176,7 @@
if (allowUnsupport) {
sp<device::V3_5::ICameraDevice> cameraDevice3_5;
sp<device::V3_7::ICameraDevice> cameraDevice3_7;
- sp<device::V3_8::ICameraDevice> cameraDevice3_8;
- castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8);
+ castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7);
bool supported = false;
ret = cameraDevice3_5->isStreamCombinationSupported(config3_4,
@@ -8282,95 +7369,6 @@
return false;
}
-void CameraHidlTest::get10BitDynamicRangeProfiles(const camera_metadata_t* staticMeta,
- std::vector<CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap> *profiles) {
- ASSERT_NE(nullptr, staticMeta);
- ASSERT_NE(nullptr, profiles);
- camera_metadata_ro_entry entry;
- std::unordered_set<int64_t> entries;
- int rc = find_camera_metadata_ro_entry(staticMeta,
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry);
- ASSERT_EQ(rc, 0);
- ASSERT_TRUE(entry.count > 0);
- ASSERT_EQ(entry.count % 3, 0);
-
- for (uint32_t i = 0; i < entry.count; i += 3) {
- ASSERT_NE(entry.data.i64[i],
- ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD);
- ASSERT_EQ(entries.find(entry.data.i64[i]), entries.end());
- entries.insert(entry.data.i64[i]);
- profiles->emplace_back(
- static_cast<CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap>
- (entry.data.i64[i]));
- }
-
- if (!entries.empty()) {
- ASSERT_NE(entries.find(ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10),
- entries.end());
- }
-}
-
-bool CameraHidlTest::is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta) {
- camera_metadata_ro_entry scalarEntry;
- int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES,
- &scalarEntry);
- if (rc == 0) {
- for (uint32_t i = 0; i < scalarEntry.count; i++) {
- if (scalarEntry.data.u8[i] ==
- ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT) {
- return true;
- }
- }
- }
- return false;
-}
-
-void CameraHidlTest::verify10BitMetadata(HandleImporter& importer,
- const InFlightRequest& request,
- CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap profile) {
- for (const auto& b : request.resultOutputBuffers) {
- bool smpte2086Present = importer.isSmpte2086Present(b.buffer.buffer.getNativeHandle());
- bool smpte2094_10Present = importer.isSmpte2094_10Present(
- b.buffer.buffer.getNativeHandle());
- bool smpte2094_40Present = importer.isSmpte2094_40Present(
- b.buffer.buffer.getNativeHandle());
-
- switch (static_cast<int64_t>(profile)) {
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10:
- ASSERT_FALSE(smpte2086Present);
- ASSERT_FALSE(smpte2094_10Present);
- ASSERT_FALSE(smpte2094_40Present);
- break;
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10:
- ASSERT_TRUE(smpte2086Present);
- ASSERT_FALSE(smpte2094_10Present);
- ASSERT_FALSE(smpte2094_40Present);
- break;
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS:
- ASSERT_FALSE(smpte2086Present);
- ASSERT_FALSE(smpte2094_10Present);
- ASSERT_TRUE(smpte2094_40Present);
- break;
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM:
- case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO:
- ASSERT_FALSE(smpte2086Present);
- ASSERT_TRUE(smpte2094_10Present);
- ASSERT_FALSE(smpte2094_40Present);
- break;
- default:
- ALOGE("%s: Unexpected 10-bit dynamic range profile: %" PRId64,
- __FUNCTION__, profile);
- ADD_FAILURE();
- }
- }
-}
-
bool CameraHidlTest::isDepthOnly(const camera_metadata_t* staticMeta) {
camera_metadata_ro_entry scalarEntry;
camera_metadata_ro_entry depthEntry;
@@ -8534,9 +7532,8 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
- castSession(*session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
+ castSession(*session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
*useHalBufManager = false;
status = find_camera_metadata_ro_entry(staticMeta,
@@ -8667,19 +7664,11 @@
void CameraHidlTest::castDevice(const sp<device::V3_2::ICameraDevice>& device,
int32_t deviceVersion,
sp<device::V3_5::ICameraDevice>* device3_5 /*out*/,
- sp<device::V3_7::ICameraDevice>* device3_7 /*out*/,
- sp<device::V3_8::ICameraDevice>* device3_8 /*out*/) {
+ sp<device::V3_7::ICameraDevice>* device3_7 /*out*/) {
ASSERT_NE(nullptr, device3_5);
ASSERT_NE(nullptr, device3_7);
- ASSERT_NE(nullptr, device3_8);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8: {
- auto castResult = device::V3_8::ICameraDevice::castFrom(device);
- ASSERT_TRUE(castResult.isOk());
- *device3_8 = castResult;
- }
- [[fallthrough]];
case CAMERA_DEVICE_API_VERSION_3_7: {
auto castResult = device::V3_7::ICameraDevice::castFrom(device);
ASSERT_TRUE(castResult.isOk());
@@ -8723,27 +7712,19 @@
}
//Cast camera device session to corresponding version
-void CameraHidlTest::castSession(const sp<ICameraDeviceSession> &session, int32_t deviceVersion,
- sp<device::V3_3::ICameraDeviceSession> *session3_3 /*out*/,
- sp<device::V3_4::ICameraDeviceSession> *session3_4 /*out*/,
- sp<device::V3_5::ICameraDeviceSession> *session3_5 /*out*/,
- sp<device::V3_6::ICameraDeviceSession> *session3_6 /*out*/,
- sp<device::V3_7::ICameraDeviceSession> *session3_7 /*out*/,
- sp<device::V3_8::ICameraDeviceSession> *session3_8 /*out*/) {
+void CameraHidlTest::castSession(const sp<ICameraDeviceSession>& session, int32_t deviceVersion,
+ sp<device::V3_3::ICameraDeviceSession>* session3_3 /*out*/,
+ sp<device::V3_4::ICameraDeviceSession>* session3_4 /*out*/,
+ sp<device::V3_5::ICameraDeviceSession>* session3_5 /*out*/,
+ sp<device::V3_6::ICameraDeviceSession>* session3_6 /*out*/,
+ sp<device::V3_7::ICameraDeviceSession>* session3_7 /*out*/) {
ASSERT_NE(nullptr, session3_3);
ASSERT_NE(nullptr, session3_4);
ASSERT_NE(nullptr, session3_5);
ASSERT_NE(nullptr, session3_6);
ASSERT_NE(nullptr, session3_7);
- ASSERT_NE(nullptr, session3_8);
switch (deviceVersion) {
- case CAMERA_DEVICE_API_VERSION_3_8: {
- auto castResult = device::V3_8::ICameraDeviceSession::castFrom(session);
- ASSERT_TRUE(castResult.isOk());
- *session3_8 = castResult;
- }
- [[fallthrough]];
case CAMERA_DEVICE_API_VERSION_3_7: {
auto castResult = device::V3_7::ICameraDeviceSession::castFrom(session);
ASSERT_TRUE(castResult.isOk());
@@ -9661,9 +8642,8 @@
sp<device::V3_5::ICameraDeviceSession> session3_5;
sp<device::V3_6::ICameraDeviceSession> session3_6;
sp<device::V3_7::ICameraDeviceSession> session3_7;
- sp<device::V3_8::ICameraDeviceSession> session3_8;
- castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5,
- &session3_6, &session3_7, &session3_8);
+ castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6,
+ &session3_7);
ASSERT_NE(nullptr, session3_5.get());
hidl_vec<int32_t> streamIds(1);
@@ -9905,7 +8885,7 @@
size_t CONFIG_ENTRY_TYPE_OFFSET = 3;
size_t CONFIG_ENTRY_BITFIELD_OFFSET = 4;
uint32_t maxPublicUsecase =
- ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8;
+ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END;
uint32_t vendorUsecaseStart =
ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START;
uint32_t usecaseMask = (1 << vendorUsecaseStart) - 1;