- Handle various corner cases with regard to REQUEST_ERROR, RESULT_ERROR, and BUFFER_ERROR.
- Drain the codec outputs in case the input buffer isn't dropped.
- Allow APP_SEGMENT to drop while still producing valid output image.
- Add a status tracker to manage active/idle state.
- Use frame number as key for pending input frames since with ZSL, 2
capture result could have the same timestamp.
- Also removed some deprecated variable/methods.
Test: CTS, vendor testing
Bug: 145579077
Change-Id: I9c3e929469b8fb75b32b016f9006036c954f663f
Handle the case where the HAL doesn't advertise
preCorrectionActiveArraySize by initializing it to activeArraySize.
Test: "dumpsys media.camera" before and after the change
Bug: 145300768
Change-Id: I1281686d9b324793a4a99c6a4ddf5d693172507b
Camera metadata entries can become invalid
after updates. Avoid using the possibly
released entry pointer when extending
camera characteristics with dynamic depth
tags.
Additionally simplify rotate and crop
region checks.
Bug: 152240541
Test: cameraservice_test
Change-Id: I416739ed7e128f4ec94353ec2938b9bf226be182
Having a sp<ProviderInfo> in DeviceInfo resulting in the parent
ProviderInfo not being deallocated.
Test: Check camera characteristics object freed by killing provider
Bug: 149813446
Change-Id: Ic15ffcd3a5ce424187877e17a14b4db581e2c50a
cameraserver should re-cache concurrent camera id combinations when it
receives cameraDeviceStatusChange callbacks from the camera provider in
case new concurrent camera id combinations have appeared / old ones have
gone away.
Bug: 148995918
Test: atest ConcurrentCameraTest.java
Change-Id: Ic433495d2dcf98d00cb247f434ad6c798ea17c54
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Notable fixes:
- Rework FrameProcessorBase so it accept and work with
offline sessions.
- Erase internal composite streams from offline stream list.
Bug: 135142453
Test: Camera CTS
Change-Id: I9dbc01e62fa94c1e0bfb84a8ddaa9e39ab4a7e34
- getConcurrentStreamingCameraIds() :
returns a list of combinations of camera ids that may stream
concurrently.
- isConcurrentSessionConfigurationSupported() :
queries whether camera devices can support the
corresponding given session configurations concurrently.
Bug: 77960042
Test: GCA (sanity)
Test: CTS
Change-Id: Iba237118ccf145695a500a2c406713e416e66011
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
When an app sets SCALER_ROTATE_AND_CROP to AUTO, the camera service
needs to select the right ROTATE_AND_CROP mode given the application
UI state at the moment, received from the window manager.
In addition, some of the metadata in the active array coordinate
system needs to be converted to/from the cropped+rotated coordinate
system to ensure roundtripping UI information works as before.
Also ensure that the available rotate and crop metadata field is
always available, with a value of NONE if nothing else.
This commit adds support for doing the coordinate transforms and
overriding AUTO to a concrete value; it does not wire up a connection
to another system service to receive the correct override value, but
does add a command to set the override value for all current camera
clients.
Test: New CTS tests pass, unit tests for RotateAndCropMapper pass
Bug: 134631897
Change-Id: Icc45530e2cfbaf838a1e4d04e4fd2aef8122e8e1
The new provider callback version enables availability callback for
physical camera.
Test: Camera CTS
Bug: 119325027
Change-Id: I22e0b669c3d9891a431e1befc7f1c9f40b826a08
Camera clients must be aware of any configured streams
that can support offline processing mode.
A few corner cases that need to be considered:
- Composite streams can support offline mode only
when all internal streams support it as well.
- Streams that use the internal camera buffer manager
will not have support for offline mode.
- Shared streams are also unsupported in offline mode.
Bug: 135142453
Test: Camera CTS
Change-Id: Idde826a6fb18a8907850e87cfe593de7cb1c5f4a
Integrate dynamic depth processing as part of
the camera service library.
Dynamic linking is no longer required as legacy
devices with small system partitions are not
supported.
Bug: 132449311
Test:
atest
cts/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#testDynamicDepthCapture
atest
cts/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#testDynamicDepth
atest
cts/tests/camera/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java#testDepthOutputCharacteristics
cameraservice_test --gtest_filter=DepthProcessorTest.*
Change-Id: Ie8befc5c0635e3e08c7ad8cac7b056cdf5aa3548
ZoomRatioMapper's member variables are const after construction. As a
result, we don't need mutex to protect updateCaptureRequest and
updateCaptureResult calls.
Also fixed missing zoom ratio mapping initialization for physical
sub-camera.
Test: testZoomRatio CTS
Bug: 130025314
Change-Id: Ibe2ff7cffb13178dcf70fc9e2eb044184e58bcf2
- Add NDK API spec for the new zoom API
The new zoom API combines optical and digital zoom, and supports both
zoom-out and zoom-in with more precision.
- Add new NDK API to specify separate zoom ratio ranges for different
bokeh modes.
- Add ZoomRatioMapper in camera service to convert between
control.zoomRation to and from scaler.cropRegion.
Test: Camera CTS/ITS/CtsVerifier/ZoomRatioTest
Bug: 130025314
Change-Id: I4c7d867f840b5720bc73bb0485e8a9a93d2276b5
Bug: 136595429
Test: atest CtsAppOpsTestCases (now including two new test cases that
open a camera with a null and a non-null feature)
Change-Id: Idfb8f8049dff536525d4f081151c79d980d76c69
When initially starting up, use tryGetService instead of getService to
avoid blocking camera service start in cases where the camera HAL is stuck.
Test: atest cameraservice_test && atest CameraManagerTest, with and without
lazy camera HAL
Change-Id: I2ad5c542e77e748902cfb49f90a55620b29ad4cd
The following scenario can occur:
T1 serving Client A's disconnect() call:
T2 : serving Client B's connect() call
T2 : CameraProviderManager::openSession() locks mInterfaceMutex and waits on open() HAL
interface call
T1: updateStatus() locks mStatusListenerMutex
T1: CameraProviderManager::isPublicallyHiddenSecureCamera() / getSystemCameraKind() waits
on mInterfaceMutex
T2: while waiting on open(), gets a torchModeStatus() callback from the camera HAL
T2: onStatusChanged()
T2: broadcastTorchModeStatus() which waits on mStatusListenerMutex
As a result there's a possible circular hold and wait between T1 and T2.
We cache the system camera kind in CameraState. That doesn't completely
avoid having to hold mInterfaceLock while calling getSystemCameraKind in
CameraService (cache updates), instead it reduces it. We instead need to
hold mCameraStates lock which has a smaller scope.
Bug: 141756275
Test: CTS
Test: GCA (sanity)
Change-Id: I4a697c1eaccc3603007be4a595febea981fbeb64
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
In camera1 api
- getNumberOfCameras won't count hidden secure cameras.
- getNumberOfCameras will return public non system cameras or public
cameras depending on whether the client has SYSTEM_CAMERA and CAMERA
permissions or not.
- getCameraInfo checks for SYSTEM_CAMERA and CAMERA permissions in case
the info is requested for a system camera.
Bug: 140243224
Test: Harcode all cameras as SYSTEM_ONLY_CAMERA; cts camera1 tests
get 0 on calling getNumberOfCameras() without using
adoptShellPermissionIdentity().
Test: Harcode all cameras as SYSTEM_ONLY_CAMERA; cts camera1 tests
get a finite number on calling getNumberOfCameras() when
adoptShellPermissionIdentity() is used.
Test: Harcode all cameras as HIDDEN_CAMERA; cts camera1 tests
get 0 when calling getNumberOfCameras.
Change-Id: I9d1721fd5e94fa7f692c3da52aa667ae9247d368
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Camera preview stop only waits until the
current capture request is sent to Hal and
then immediately flushes the device.
Depending on timing and the pending request
queue size within CameraHal the current camera
client parameters may get flushed before
they are able to reach the end of the
processing pipeline.
Avoid this by waiting for the current request
id to appear in the incoming results.
Bug: 139330668
Test: Camera CTS, manual using application
Change-Id: I18de85557e8e76bfbe6d69b1eb2a5c36ed64e803
Bug: 133508924
Bug: 138135733
android.permission.CAMERA and android.permission.SYSTEM_CAMERA are both
required by a client process to access system only cameras.
Test: Advertise the back camera as system only;
1) don't give Camera2 SYSTEM_CAMERA permissions,
Camera2 can't connect to the back camera
2) give Camera2 SYSTEM_CAMERA permissions, Camera2 successfully
connects.
3) 3P app can't connect to any camera if all cameras are
advertised as SYSTEM_ONLY_CAMERAs.
Test: CTS CameraDeviceTest, CameraManagerTest
Change-Id: I0309462f962d9c8c92564ef6781b2aae1485a933
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Replace the item MIME type with value supported
by the dynamic depth specification.
Bug: 138399780
Test: runtest -x
cts/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
-m testDynamicDepth
Change-Id: Ib51dd69e6de7da3269eccfa6b671fe95a269b4d6
This is to reduce application confusion when switching between back and
front cameras.
Test: Observe dumpsys on a phone with NIR camera device
Bug: 133141567
Change-Id: I0c11b99fc3a0304d54562548d109df8c56ba1db1
Also remove the expected argument in addProviderLocked method as
we now can query from device manifest for instance names.
Test: manually modify Pixel3 manifest to test, CTS
Bug: 136010319
Change-Id: Ib57fd84ad8f22aac2a82920e03148cff2592daae
Make sure 'jpeg_destroy_compress()' is always called
before leaving 'encodeGrayscaleJpeg()'.
Additionally fix misspelling of 'intrinsic'.
Bug: 135622974
Test: atest
cts/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#testDynamicDepth
--generate-baseline=12
Change-Id: I55c1f86881ba05aac6aac6981df5fcb276c9d4da
Depth samples with low confidence can skew the
near/far values and impact the range inverse coding.
Avoid using such samples when searching for the near
and far points and clamp their values if necessary.
Bug: 132248813
Test: Camera CTS
Change-Id: I7dc134b50e46c664f9fc8750b9b9b37c416c9afe
Add below logical camera support to dumpsys:
- Physical camera id to stream info.
- Physical camera request/result metadata.
- Physical camera metadata in tag monitor.
Also fixed an issue of missing vendor tags in physical metadata.
Test: Run physical streams and observe dumpsys
Bug: 111940580
Change-Id: I02889b213ff5e7ec29506c0483ef40de9d107ccb
For Camera1-HAL3 shim, the camera ID filtering logic is revised to
handle case of multiple logical cameras facing the same direction,
and are backed by same/different set of physical camera IDs.
Example 1 (all facing back):
ID1 = ID3 + ID4
ID2 = ID5 + ID6
Example 2 (all facing back):
ID5 = ID1 + ID2
ID6 = ID3 + ID4
In both examples, only ID1 will be advertised to camera1 app.
Test: Check cameras on devices with multiple logical cameras
Test: Camera CTS
Bug: 113705942
Change-Id: I76f370938b3311bbe7adcac8eddf8b6cf08e4571
Depth and confidence maps require physical rotation in
case the source color image has similar physical rotation.
The EXIF orientation value will be kept consistent and
set to 0 in case of physical rotation.
Bug: 123699590
Test: Manual using application,
adb shell /data/nativetest64/cameraservice_test/cameraservice_test
--gtest_filter=DepthProcessorTest.*
Change-Id: I5cdd41c89368a1841d53f2195790aa1b55258495
Depth and confidence maps should always use the same
EXIF orientation as the main color image.
Bug: 123699590
Test: Manual using application,
Camera CTS,
adb shell /data/nativetest64/cameraservice_test/cameraservice_test
--gtest_filter=DepthProcessorTest.*
Change-Id: I0d887798e8717cdff81aba10d595dc3ccfe99197
- Derive HEIC capabilities from camera HAL and media framework.
- Add HeicCompositeStream to encode camera buffers to HEIC buffers.
- Add ExifUtils to overwrite JPEG APP segments and send to media codec.
- Add NDK enums and corresponding format support.
Test: Camera CTS
Bug: 79465976
Change-Id: I0a885e76335f3eba4be0fd42241edb0b7349f284
hwservicemanager now guarantees clients will be held for ~5s before the
callback onClients(false) is called and they are allowed to exit.
Test: On walleye_svelte, manually observe camera behavior and the
lifetime of the lazy camera service process.
Change-Id: Iafbdd73f439da3a4f0fecb069e356d30aa2732b5
Add AIDL method for device-wide physical state updates (such as
folding/unfolding), and wire it up to the new camera provider HAL call.
Also clean up camera provider startup sequence - devices were being enumerated before
the new lazy HAL interface pointers were set up, resulting in many repeated calls
to getService even for a non-lazy HAL.
Also add unit test for CameraProviderManager to verify its section of
the callpath, as well as tests to check that the provider HAL and
hardware service manager aren't queried more than expected during
initialization.
Test: atest cameraservice_test
Change-Id: I5ec60fd9d93b7a2fe4d1a5854fad720a972fe8ea
Failing to add dynamic depth camera characteristics
must not have any additional side effects for the
device info constructor.
In case we encounter any issues report the failure and
try to continue with the intitialization.
Additionally fix a minor typo and remove a debug log.
Bug: 123660999
Test: Manual using application,
Camera CTS
Change-Id: I7b4e723ce3bcaf0e5d4c313ba17bca965e8964d8
Move all depth photo specific processing in a separate
library and link to it dynamically.
Bug: 109735087
Test: Camera CTS
Change-Id: I00a20b26fc9a1d127ad962a36b5b554dd36f0d41
Add the necessary logic to support dynamic depth metadata.
Bug: 109735087
Test: Manual using application,
Camera CTS
Change-Id: Ic4710872dc596bc718270e1c79d4da53fb850875
Composite dynamic depth streams will be supported
in case camera devices include:
- Dense depth streams which are not exclusive.
- Jpeg/Blob output with sizes that either match depth
or are with similar aspect ratio.
Make a guesstimate regarding the dynamic depth minimum
frame and stall durations.
Bug: 109735087
Test: Manual using application,
Camera CTS
Change-Id: I8a89c7895cf57ce4408e41b1afae9c85d48c4e07
Drop camera HAL references when unused.
Use ro.camera.enableLazyHal property to toggle behavior on or off.
* If true, the cameraserver drops references to ICameraProvider HALs
when they are not being used for either camera or torch.
* If false (or unset), stores a strong reference to each ICameraProvider
that is registered. This is the same as the old behavior.
Bug: 79374634
Test: Apply CL that lets camera HAL exit when unused. Open camera/enable
torch, close camera/disable torch, check ps -A to see if HAL exits.
Change-Id: I1842f9bf9e862ab74e4ec8aa72fc46fc47782ed0