Commit Graph

570 Commits

Author SHA1 Message Date
Shuzhen Wang
84bc4a190d Merge "Camera: Allow non-session parameters in SessionConfiguration" into main 2024-01-16 16:38:31 +00:00
Avichal Rakesh
aca04275d9 Merge changes from topic "309543399-ext-hal" into main
* changes:
  ExternalCameraHAL: Add ANDROID_SENSOR_READOUT_TIMESTAMP key.
  camera: Make readoutTimestamp visible to HALs
2024-01-13 00:33:57 +00:00
Jayant Chowdhary
1748677f02 Merge "Check for stream use case capability before stream use case test" into main 2024-01-12 21:47:30 +00:00
Jayant Chowdhary
da59822642 Check for stream use case capability before stream use case test
Bug: 299202800

Test: Vendor testing

Change-Id: If30ead47072dc1f950b8fb6384072cc38cd51c58
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-11 21:02:08 +00:00
Avichal Rakesh
468341e677 camera: Make readoutTimestamp visible to HALs
`readoutTimestamp` metadata key was previously only visible to
SDK and the framework, and the camera framework force set the values
based on if the HAL implemented the AIDL or the HIDL interface.

This CL makes readoutTimestamp available to HALs and lets AIDL
HALs choose if they can support sensor readout timestamp or not.

Bug: 309543399
Test: External Camera HAL now sets this value and passes VTS
Change-Id: Ifee2b4020b7630383dc32ef7590f8a9ccdaf49d2
2024-01-10 12:46:57 -08:00
Jayant Chowdhary
2d51f59db5 Merge "camera: Add boolean to HalStream for stream specific HAL buffer manager" into main 2024-01-06 07:15:44 +00:00
Shuzhen Wang
918ecd17aa Camera: Allow non-session parameters in SessionConfiguration
Also remove a workaround in VTS test

Test: Build
Bug: 309627704
Change-Id: I0ed266e837f5d0bec6197ff9f725a897048038ae
2024-01-05 23:22:56 +00:00
Jayant Chowdhary
4869ae7838 camera: Add boolean to HalStream for stream specific HAL buffer manager
Whether the HAL buffer manager is used or not is decided
based on the presence of a static camera characteristics key -
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION. This behavior cannot
be toggled depending on stream configuration / session parameters.

The HAL buffer manager does reduce memory consumption at the cost of
extra IPC calls, which may not be always desirable.

Therefore, HalStream.aidl - the parcelable returned by the camera HAL
for each stream configured now holds a boolean value, specifying
whether output buffers must be managed by the HAL or the camera
framework for the particular session configured.

Bug: 311263114

Test: builds

Test: Run Camera CTS on HAL supporting
      ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE

Test: VTS

Change-Id: Id6bda31eab3d66361991e2f883231a5a55a2ef82
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-04 18:32:19 +00:00
Shuzhen Wang
a6bac13c93 Merge "Revert "Revert "Camera: VTS: Require ConstructDefaultSettings fo..."" into main 2023-12-21 21:59:55 +00:00
Shuzhen Wang
dba6eaa0ba Revert "Revert "Camera: VTS: Require ConstructDefaultSettings fo..."
Revert submission 25718441-revert-25658204-EnableFeatureCombination-KTSPSCPBVP

Reason for revert: Re-land HAL implementation of feature combination query

Reverted changes: /q/submissionid:25718441-revert-25658204-EnableFeatureCombination-KTSPSCPBVP

Bug: 309627704
Change-Id: Iaec3f2ea4d028216a381f6c2ef5f2f019adabc46
2023-12-21 21:57:43 +00:00
Bharatt Kukreja
48c35ba72a Add VTS test for getSessionCharacteristics
Test: atest VtsAidlHalCameraProvider_TargetTest
Bug: 314386872
Change-Id: I3f838fd041e6aca4b12fad512f57287a94149c6e
2023-12-21 18:59:48 +00:00
Shuzhen Wang
7a237d1545 Revert "Camera: VTS: Require ConstructDefaultSettings for new HAL"
Revert submission 25658204-EnableFeatureCombination

Reason for revert: b/317270728

Reverted changes: /q/submissionid:25658204-EnableFeatureCombination

Change-Id: Id048e9bd5ba08f7856ccf88fd7bfdca06ce0727c
2023-12-20 22:22:12 +00:00
Shuzhen Wang
d7f0d0ab4a Camera: VTS: Require ConstructDefaultSettings for new HAL
Test: Run VTS test on Cuttlefish and Pixel
Bug: 309627704
Change-Id: Ic65ffef691c6b2e9fefbdcbd27598b3666062a9a
2023-12-20 00:27:12 +00:00
Shuzhen Wang
df89cb9c21 Camera: Add new function to query for SessionConfiguration
- The new isStreamCombinationSupported takes into consideration
  the session parameters.
- In order to create CaptureRequest in ICameraDevice, a
  createDefaultRequestSettings function is needed.

Test: Run camera VTS with session_configuration_with_parameters_query flag enabled
Bug: 309627704
Change-Id: Ib344e6991484b834aa8483ed8637ce5cd02ede87
2023-12-05 03:48:51 +00:00
Jayant Chowdhary
0215d98751 Merge "camera: Add support for toggling HAL buffer manager as a result of session configuration" into main 2023-12-04 20:55:07 +00:00
Emilian Peev
9e21e0f74a Camera: Add physical camera crop metadata tag
Allow CameraHal implementations to report the physical
camera source crop.
Additionally extend the capture results with
intra-frame lens intrinsics samples.

Bug: 297083874
Test: atest VtsAidlHalCameraProvider_TargetTest
Change-Id: Ib2ad0a3b8f51813dc1aaa52f110a2946ab8787ce
2023-12-01 02:46:08 +00:00
Jayant Chowdhary
644676a583 camera: Add support for toggling HAL buffer manager as a result of session configuration
Currently, whether the HAL buffer manager is used or not is decided
based on the presence of a static camera characteristics key -
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION. This behavior cannot
be toggled depending on stream configuration / session parameters.

The HAL buffer manager does reduce memory consumption at the cost of
extra IPC calls, which may not be always desirable.

Therefore, a new API - 'configureStreamsV2()' is introduced to give the
camera HAL the ability to inform the camera framework whether it must
use the HAL buffer manager for the particular session configured.

Bug: 311263114

Test: VtsAidlHalCameraProvider_TargetTest on cuttlefish
Test: builds

Change-Id: Ibce6d64c3c9cc8e0ebc40522369291d03053cce2
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2023-12-01 00:59:01 +00:00
Rucha Katakwar
d08a015239 Camera: Vts test for manual flash control.
Test to verify configurations for manual flash strength level
control feature.

Test: Tested on an emulator with flag enabled/disabled.

Bug: 238348881

Change-Id: Iba492fe626c2fb74aa2107cec3969a04ea52eac0
2023-11-08 14:50:35 -08:00
Tang Lee
4be4471d46 Return ILLEGAL_ARGUMENT for setting null callback
Bug: 299182872
Test: Run VTS with external USB camera
vts-tradefed
> run vts -m VtsAidlHalCameraProvider_TargetTest -t \
    PerInstance/CameraAidlTest#setCallback/0_android_hardware_camera_provider_ICameraProvider_external_0 \
    --logcat-on-failure --logcat-on-failure-size 8192000 \
    --bugreport-on-failure --screenshot-on-failure

Change-Id: I013e3770ddbdcf6475e0927449af6183dcc37a8e
2023-10-02 07:18:16 +00:00
Treehugger Robot
8125e862c3 Merge "Camera VTS: Verify high speed video configurations" into main am: 607f7e7ff7 am: 68d44aa5e2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2585399

Change-Id: Ia6aa1f2395bbcf7778ea5c6820cf778168df1296
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 09:03:03 +00:00
Treehugger Robot
68d44aa5e2 Merge "Camera VTS: Verify high speed video configurations" into main am: 607f7e7ff7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2585399

Change-Id: Ib20ae0eb0bc7466acb39e7eb0409fde8641f6070
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 08:04:22 +00:00
Kwangkyu Park
4b7fd45612 Camera VTS: Verify high speed video configurations
Verify high speed video configurations based on the tag definition.

Bug: 274392420
Test: Ran on cuttlefish
Change-Id: Ie64415cc8694d8f4da59a01f6051bc847ae30fa7
2023-09-15 14:10:09 +09:00
Emilian Peev
16ce2fc577 Camera VTS: Wait for camera provider to become active am: bd4cdc6a9a am: 9610556686
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/24665985

Change-Id: Iefca832a6c244f0df88cf9e3898da282612a95d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-05 21:50:25 +00:00
Emilian Peev
bd4cdc6a9a Camera VTS: Wait for camera provider to become active
Use "AServiceManager_waitForService" instead of
"AServiceManager_getService" to wait for any camera
providers that might be using the lazy mechanism and
are not running all the time.

Bug: 297965980
Test: atest VtsAidlHalCameraProvider_TargetTest

Change-Id: I6374dc768cd1068885668f927f902dcee44a7a42
2023-09-05 18:18:49 +00:00
Xin Li
879960bdce Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I7b6fffac2ada0e039f79bad8cc9b4d954e9c3460
Change-Id: I9466127d8d0fa38df36ca99f704853b2db871e67
2023-08-25 13:29:30 -07:00
Tomasz Wasilczyk
353d4c5c75 Use String8/16 c_str [camera]
Bug: 295394788
Test: make checkbuild
Change-Id: I7ca371112e891f4f40673b5c34e3b8ccc41841bf
Merged-In: I7ca371112e891f4f40673b5c34e3b8ccc41841bf
2023-08-24 17:07:46 +00:00
Tomasz Wasilczyk
dbec48bbd2 Use String8/16 c_str [camera]
Bug: 295394788
Test: make checkbuild
Change-Id: I7ca371112e891f4f40673b5c34e3b8ccc41841bf
2023-08-23 19:47:07 +00:00
Austin Borger
0475dfe328 Camera VTS: Properly initialize Stream in various places am: 263e362091 am: 45063e6c9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/23850975

Change-Id: I4450a41690668dcf2377cca07c48e258ec046b28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 20:41:12 +00:00
Austin Borger
263e362091 Camera VTS: Properly initialize Stream in various places
useCase and colorSpace are not explicitly initialized. colorSpace must
be explicitly initialized to UNSPECIFIED, as its default value is not
zero. Without initialization, the HAL will receive incorrect Stream
data.

Bug: 287305593
Test: Ran full VTS test on Cuttlefish / OEM testing.
Change-Id: I6a29600b5dc06ebdc61b38e0585204fe52d590c2
2023-06-29 00:49:17 +00:00
Avichal Rakesh
4a675fbfd1 camera: Fix prefix length path for External Camera HAL am: b8863f6a03 am: e1390f059f am: f617111ca5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2386907

Change-Id: I0d1a4f3fcb4747dfac1d3f98e967d0b2bd8e6646
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09 02:46:14 +00:00
Avichal Rakesh
b8863f6a03 camera: Fix prefix length path for External Camera HAL
The default External Camera HAL accidentally used `sizeof` on a `char *`
to get the length of the string. This "worked" because the string in
question "/dev/" has length of 5, while on a 32-bit system `char *`
has a size of 4. This difference of 1 was handled a few lines later.

However on 64-bit system `sizeof(char *)` returns 8 which breaks the
logic later in code.

As `sizeof` was being used as a proxy for strlen, this CL converts the
uses C++'s std::char_traits::length to determine the string lengths
at compile time.

Bug: 265168485
Test: Manually tested that the calculated length is correct after the
      fix.
Change-Id: I92481a2bcb74fdbbb483ef552168debf07b2d68a
2023-06-08 17:00:35 -07:00
Steven Moreland
503ed3ae2f Merge "Camera Provider VTS: auto-gen" am: 433f0ac41d am: 7967c1a9e4 am: 576f0a3f05
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2611867

Change-Id: Iefa1bb1752e0ca033350af12af5d1e909e402db0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 20:07:30 +00:00
Steven Moreland
a405bae2d1 Camera Provider VTS: auto-gen
Upload for stashing. I need to redownload/rebuild Android to test
the new feature.

Bug: N/A
Test: atest VtsAidlHalCameraProvider_TargetTest
Change-Id: Ic9aa621b6d3e1297c83add88283559915e36311e
2023-06-05 19:55:32 +00:00
Shuzhen Wang
38ddb278b3 Camera: Adjust VTS tests for zoom override latency
Now that the zoom override latency requirement is reduced to 1 frame,
adjust the VTS test accordingly.

Test: Run VtsAidlHalCameraProvider_TargetTest on Pixel
Bug: 283196724
Change-Id: Ie05106cd79549de6b91f94b5c25ffae768982a1b
2023-05-22 09:42:38 -07:00
Austin Borger
8e9ac0249a Camera VTS: Close the session at the end of stream configuration validation
Not calling mSession->close means that there will be multiple concurrent
sessions open, which may not be supported by the device.

Bug: 280559094
Test: Ran on cuttlefish
Change-Id: Ie622fabd4d0be2f8442e90d1c781bbf905172270
2023-05-04 22:57:49 +00:00
Shuzhen Wang
e1dcc40ec3 Camera: VTS: Fix fence fd double close am: 3ad137edbb am: 2603479470 am: 7c4bb95a18 am: 36f18e9327
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2539830

Change-Id: Ifa023065ee2380dd87c898275fcd0d1cf261fcf5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-18 01:43:17 +00:00
Shuzhen Wang
2603479470 Camera: VTS: Fix fence fd double close am: 3ad137edbb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2539830

Change-Id: I6f75051e3ac3bf9d3976969ead45da306d2ff10a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-18 00:49:20 +00:00
Shuzhen Wang
3ad137edbb Camera: VTS: Fix fence fd double close
Fence fd is closed when processCaptureResult returns. In order to
wait for the release fence *after* processCaptureResult returns,
the fence fd needs to be duped.

Test: Vendor testing
Bug: 241281568
Change-Id: Ib74f9bb141802713b476a2ef48a2252125a7915d
2023-04-17 05:02:05 +00:00
Alex Buynytskyy
ec1198d941 UpsideDownCake is now 34
Ignore-AOSP-First: UpsideDownCake Finalization
Bug: 275409981
Test: build
Change-Id: I832ab7a8b5445ba85e27bbcf5be64906bfa0e5be
2023-04-07 23:41:20 +00:00
Treehugger Robot
8c242dcfac Merge "Camera: VTS: Wait for release fence before consuming buffers" into android13-tests-dev am: 1c8377c24c am: c3b6c6c691 am: 35bd55b0d7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2520900

Change-Id: I5a993cbe326db709d496cdadfabf18b774353c5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 18:46:48 +00:00
Treehugger Robot
13f7e14af3 Merge "Camera: VTS: Wait for release fence before consuming buffers" into android13-tests-dev am: 1c8377c24c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2520900

Change-Id: I02490da662338296bd76de6c9e39b8f590aae0c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 17:34:13 +00:00
Treehugger Robot
1c8377c24c Merge "Camera: VTS: Wait for release fence before consuming buffers" into android13-tests-dev 2023-04-05 17:10:33 +00:00
Shuzhen Wang
d1c14328fd Camera: Fix VTS failure for depth only camera am: 72f97643fb am: e5489ab299 am: 1dc71caa85
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2523160

Change-Id: I325c9fe2fdd0423bd7d5f219406521df8e208c60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 03:19:56 +00:00
Shuzhen Wang
3d44601e7f Camera: Fix VTS failure for depth only camera am: 72f97643fb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2523160

Change-Id: I849cf4e48e18cc88ec6e62eb4066f2ff05887fa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 02:07:10 +00:00
Shuzhen Wang
72f97643fb Camera: Fix VTS failure for depth only camera
If the device is depth-only, use threshold with Y16 format rather than
IMPLEMENTATION_DEFINED.

This fixes the regression introduced by the fix for b/265984260.

Bug: 276957901
Test: atest VtsAidlHalCameraProvider_TargetTest
Change-Id: If9023f1ed17bb761abbb9be36e567264f8bf0689
2023-04-04 20:57:27 +00:00
Shuzhen Wang
0f56c56709 Camera: VTS: Wait for release fence before consuming buffers
The camera HAL may signal release fence after processCaptureResult.
If the VTS test waits for the release fence in the context of the
capture result, there is possibility of deadlock.

Rather, we should wait for the releaseFence in a different thread
context to really emulate the real application behavior.

Test: atest VtsAidlHalCameraProvider_TargetTest
Bug: 241281568
Change-Id: Id1d92e901aae1cab084846d252ef090fcda182d7
2023-04-04 16:45:28 +00:00
TreeHugger Robot
90c8cd9a3b Merge "Camera: VTS: Fail test if availableSettingsOverride is empty" into udc-dev 2023-04-04 04:57:36 +00:00
Shuzhen Wang
49cb038af1 Camera: VTS: Fail test if availableSettingsOverride is empty
If availableSettingsOverride key is in CameraCharacteristics, it must
contains at least OFF.

Test: atest VtsAidlHalCameraProvider_TargetTest
Bug: 272546819
Change-Id: If6fb7275fc1191947dc120c9873274f4a1883720
2023-03-31 15:44:40 -07:00
Austin Borger
5e80374926 Camera VTS: Fix processColorSpaceRequests.
Changes were made to process10BitDynamicRangeRequest and the way frames
are numbered. This needs to be carried over to
processColorSpaceRequests.

Bug: 275007341
Test: Ran process10BitColorSpaceRequest / process8BitColorSpaceRequest
Change-Id: Ia0eb2fd71aff1bfc8398c85c68e1b9575a1cc058
2023-03-24 18:29:39 -07:00
Austin Borger
7dd74a94c2 Merge "Camera VTS: Updated ColorSpaceNamed and color space tests." into udc-dev 2023-03-22 20:04:15 +00:00