External USB camera hal service crashes when disconnecting the camera.
ExternalCameraDeviceSession's desctructor is called and deletes mLock,
but mBufferRequestThread is still running and waiting on the same
mLock, which causes the "pthread_mutex_lock called on a destroyed
mutex" error.
Fix the issue by stopping the thread in destructor. Also refactors the
functions and remove unused conditions.
Bug: 289741662
Test: Test with USB camera
Change-Id: I06b1ff6e192a4bca16822785d65d68a6aae53414
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
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
Upload for stashing. I need to redownload/rebuild Android to test
the new feature.
Bug: N/A
Test: atest VtsAidlHalCameraProvider_TargetTest
Change-Id: Ic9aa621b6d3e1297c83add88283559915e36311e
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
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
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
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
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
If availableSettingsOverride key is in CameraCharacteristics, it must
contains at least OFF.
Test: atest VtsAidlHalCameraProvider_TargetTest
Bug: 272546819
Change-Id: If6fb7275fc1191947dc120c9873274f4a1883720
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
BT2020_HLG and BT2020_PQ were adding since the ColorSpaceProfiles tests
were checked in. Add those to the ColorSpaceNamed enum.
Also remove unsupported color spaces from the list of 8-bit color spaces
to test, and change BT2020 to BT2020_HLG.
Test: Ran on Pixel 7.
Bug: 274789672
Change-Id: I9625a1f05017ccdcb383cdf8fd13084688acc79f
Vendor static metadata entries related to the stream configuration tags
like min frame duration, stall duration could include duplicate or
invalid data. Check that this is not the case.
Initially, this test only has impact for 10-bit HDR devices. More checks
will be added in the future.
Bug: 269165407
Test: Ran test on Pixel 7.
Change-Id: I2ad820c1ba4753508fa1f61b31b51739358099ea
For data analysis from HAL logs, it is helpful to get some higher level
information of the camera usage (such as the client's package name).
HALs are denied access to this higher level information at runtime.
To help data with data analysis, cameraservice will now pass a session
identifier when configuring streams. This identifier can be used to
correlate HAL logs with cameraservice logs at the time of log
consumption. However this correlation cannot be made at runtime. This
identifier is randomly generated and has no functional purpose and can
be safely disregarded by HAL implementations that don't want to
correlate their logs to cameraservice logs.
Bug: 271171714
Test: Manually verified that cameraservice sends correct logId to the
HAL.
Change-Id: Ib0823a9de8f573233a6e037c178a4398eb26e7ef
For private reprocessing, the ImageReader used to produce images into
the ImageWriter isn't aware of the overridden format. If the HAL decides
to override the input IMPLEMENTATION_DEFINED format, reprocessing will
fail.
Document this limitation in the HAL interface.
Test: Build
Bug: 266954992
Change-Id: I9bd05e9682e4d11870bf9bd25763f28291faef75
Per camera metadata definition, ROTATE_AND_CROP_AUTO will never be sent
to the HAL, as camera service takes reponsibility of translating AUTO to
specific rotation value. So for VTS tests, we should always override
the metadata in CaptureRequest.
Bug: 270052579
Test: Run VtsAidlHalCameraProvider_TargetTest
Change-Id: I96f4992e145da25c463b0b406aa2a371af30f41f