android_convertGralloc1To0Usage() is used to convert gralloc1_usage(uint64_t) to gralloc_usage (int32_t),
then passed as a para in allocateGraphicBuffer(). But definition of allocateGraphicBuffer() is as
void CameraAidlTest::allocateGraphicBuffer(uint32_t width, uint32_t height, uint64_t usage, PixelFormat format, buffer_handle_t* buffer_handle).
The type of "usage" is uint64_t. So the convert (uint64_t -> int32_t -> uint64_t) will change usages(31 bit is 1)
such as 0x0000000080020b00 to 0xffffffff80020b00. It's unexpected.
Use ANDROID_NATIVE_UNSIGNED_CAST to fix the issue.
Bug: https://issuetracker.google.com/issues/330051542
Change-Id: I23dfd603be0da6864d1021a57c3c3ce76cb78bda
Signed-off-by: Fang Hui <hui.fang@nxp.com>
For every request, either requestStreamBuffers fails or
handling of the requested buffer fails, always trigger
the processCaptureResult callback by notifying the request
is ready. This avoids the errors like the service side
receives fewer results than the requests and waits until
timeout.
Bug: 299182874
Test: cts
cts-tradefed run cts \
--include-filter "CtsCameraTestCases android.hardware.camera2.cts.RobustnessTest" \
--include-filter "CtsCameraTestCases android.hardware.camera2.cts.PerformanceTest" \
--include-filter "CtsCameraTestCases android.hardware.camera2.cts.StillCaptureTest" \
--include-filter "CtsCameraTestCases android.hardware.camera2.cts.SurfaceViewPreviewTest" \
--include-filter "CtsCameraTestCases android.hardware.cts.CameraGLTest" \
--include-filter "CtsCameraTestCases android.hardware.cts.LegacyCameraPerformanceTest" \
Merged-in: I86ba422524e79af6b318b50bd6eebe2cb27fa50a
Change-Id: I86ba422524e79af6b318b50bd6eebe2cb27fa50a
After enabling HALL Buffer Management, it requires more careful
error handling and syncing. Process the buffer request error correctly.
Handle the lock and states correctly.
Bug: 299182874
Test: CTS passed, expecially
./cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.NativeCameraDeviceTest
./cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.RobustnessTest
Merged-in: I04d8e19a2ee78580e54340378122c724a3de8edb
Change-Id: I04d8e19a2ee78580e54340378122c724a3de8edb
ExternalCameraHAL supports HAL buffer management which means
cameraservice will not send it an output buffer along with the
capture request, and the HAL has the freedom to request an
output buffer when an output buffer is needed.
As a remnant of migration from HIDL to AIDL, the
ExternalCameraHAL still attempted to import buffers that
the cameraservice has sent with the CaptureRequest. However,
with HAL buffer manager enabled, this buffer is always null and
results in the HAL failing to process the capture request.
This CL removes the logic for importing output buffers when
processing capture requests from the cameraservice, and lets
the HAL call requestStreamBuffers when it needs an output buffer.
Bug: 299182874
Test: VTS Tests now pass
Merged-in: I00654836b7ae91a91a2afa4b149712977e07dcc5
Change-Id: I00654836b7ae91a91a2afa4b149712977e07dcc5
native_handle objects created by makeFromAidl need to be deleted
with native_handle_delete. Not doing so leads to a memory leak
every time makeFromAidl is called.
This CL ensures that native_handle_delete is called on the
return value of makeFromAidl wherever it is used.
Bug: 305638723
Test: n/a. No functional change.
Merged-in: Ia99ba6e3abbdf7dec75383450a60c944b92a9c74
Change-Id: Ia99ba6e3abbdf7dec75383450a60c944b92a9c74
AIDL's NativeHandle do not have a concept of unowned file
descriptors. If a NativeHandle object is created with an
fd, NativeHandle implicitly assumes ownership of the fd.
When passing fds over binder, ExternalCameraHAL used
makeToAidl which which accidentally transferred ownership
to the AIDL objects. Additionally, NativeHandles close
owned fds on destruction, which led to multiple closure
of fences.
This CL changes the logic to use dupToAidl to ensure that
NativeHandle objects are given ownership of a duped fds
and don't interfere with any of the fds used for internal
bookkeeping.
Bug: 313115623
Test: Verified by partner that ExternalCameraHAL no longer double closes fds.
Merged-In: Ic406634de6f22a290abb414e80a7747927368b68
Change-Id: Ic406634de6f22a290abb414e80a7747927368b68
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.
For more details please refer to the link below,
go/new-android-ownership-model
Bug: 304529413
Test: N/A
Change-Id: Ic8c4bd6ac246e7efa98bbdaf822d12ae8e1230a5
There are no mandatory stream combinations for RAW_SENSOR streams that
do not involve the CROPPED_RAW stream use case. So we don't need to test
stream non CROPPED_RAW stream use cases with the RAW_SENSOR format,
since we don't have a definite answer to whether they will be supported or not.
Bug: 317773720
Test: Camera VTS on cf
Test: Vendor testing
Merged-In: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8
Change-Id: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 6847115a00)
Buffer manager is used in the external camera, but the key is not included in the aidl.
Add a buffermanger key according to the key definition.
Test: Test with USB Camera
Change-Id: I8c8c35d933fecb14dcf39996c709b643db3ee3e3
- 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
Some recent change in doclava resulted in broken link for {@link...}
with href's that are not class/method.
Use direct href instead.
Test: read docs
Bug: 303582215
Change-Id: I57ee60d73fe70fc2e0cd5cbf7ea73c59af398c72
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>
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
Pointer to native_handle_t created using native_handle_create should
be cleaned up using native_handle_delete even if the fds in the
native_handle is no longer managed by it. ExternalCameraDeviceSession
creates native_handle_t as an intermediate to convert to AIDL
NativeHandle but doesn't call native_handle_delete on the
intermediate object which led to memory leaks.
This CL removes the intermediate object and copies the fence fd
directly.
Bug: 305638723
Test: No functional change. Compilation successful.
Change-Id: Ie3c558ee1ae6d2e84053b65eed7db179118395bb
AIDL cannot send nullptr when parceling NativeHandles. Instead, it
sends an empty handle. Logic which previously relied on null
checks should now rely on checking if the native_handle is
empty or not.
This CL updates ExternalCameraUtils to check for empty handles
instead.
Bug: 299170474
Test: CameraAidlTest#processCaptureRequestInvalidBuffer passes
Change-Id: Id4ba928defaa061708a3c1cd68aa510b376f6cb3
Revert submission 24913374-revert-24747509-camera_fail2-OVHUVTAXRP
Reason for revert: 32-bit TV build is fixed with `%zu` instead of `%lu` for size_t argument.
Reverted changes: /q/submissionid:24913374-revert-24747509-camera_fail2-OVHUVTAXRP
Change-Id: I16287ce2dbea034db41450a3a5e9c3f729e76335
Revert submission 24747509-camera_fail2
Reason for revert: DroidMonitor-triggered revert due to breakage
b/302990858.
This may cause CtsAppOpsTestCases b/300115646 to fail again,
unfortunately (b/300115646).
Bug: 302990858
Reverted changes: /q/submissionid:24747509-camera_fail2
Change-Id: I0191b3ee88846f5b2c6e37ebd6be6d1369d9dba9
HIDL mapper HAL is deprecated and instead of adding more support for the
new replacement explicitly, we can move the GraphicBufferMapper which
handles all of the backwards compatbility with the HIDL HALs for us.
Test: atest CtsCameraTestCases CtsAppOpsTestCases
Bug: 285605852
Bug: 300115646
Change-Id: Ib97e429a0f3dd1c66ec008fbf3860c9c5667bddd