Monitored camera tag dump options should be stored
by camera service and parsed during initialization of
each new camera client.
Bug: 71640311
Test: Camera CTS,
Manual using application
Change-Id: Id464fbaec40395e93969b90abbd07f0a5cd0dc30
* Swap definition of fpsRange and fpsSingle to present correct value.
Without this patch, setPreviewFpsRange() and setPreviewFrameRate()
methods may not work correctly.
Test: partner testing
Bug 73020119
Change-Id: I7a504bb698985489e0bee595db62c99bc2c4db64
Add physical camera ID in OutputConfiguration so that the application
can optionally set physical camera id for an output stream.
Test: Camera CTS
Bug: 64691172
Change-Id: I5909cd71618cc07ef403c420913eb1c02f1e10f0
If the device support ZSL, drop pending preview buffers to reduce
the chance the rendering preview frames newer than the still frame
during takePicture().
Test: CTS
Bug: 67497723
Change-Id: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
Merged-In: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
If the device support ZSL, drop pending preview buffers to reduce
the chance the rendering preview frames newer than the still frame
during takePicture().
Test: CTS
Bug: 67497723
Change-Id: I5f253a402a6302d31777ad4ca2878ef0d0d1ae44
(cherry picked from commit c75eb9b126b2c6b7fc8f47d8ae4e4ac15f6a176e)
If enableZsl is enabled in still capture template, disable ZSL in
the framework and use device level ZSL instead.
Test: CTS
Bug: 64117056
Change-Id: Ia7f7e3b0212419a12bc1ccb3f708f527b8a0b12c
It is allowed and expected some stream formats to get overriden
by the Hal implementation. In such cases the original format should
be stored and made available to device clients.
Bug: 64571102
Test: Camera CTS
Change-Id: Ic1153390e0c4d194475fbda8c8a13323bd7e73c0
No length field after SOI, just jump it.
Change-Id: Ie49bf5230cbeafe17be2c9caac679b5fec08fc13
Signed-off-by: fang hui <hui.fang@nxp.com>
(cherry picked from commit 5bdf8e6f428893c2470c99b2bd9dd029bfe9decc)
The size of ae regions may be zero by rounding error.
But it should be at least 1 if metering area size is not zero.
This problem causes CTS fail for
android.hardware.cts.CameraTest#testMeteringAreas on
the device which has the active array width less than 3556
if the preview size is 1920x1080.
Bug: 63795820
Test: ran Camera CTS
Change-Id: Ie3995e40aedba193393df8fd05d95f740a25ef3d
- Remove hand-written ICameraServiceProxy C++ impl; use the AIDL-
generated version instead
- Send client package name and camera facing with the camera state
notices
Test: Verify by logging that information sent to proxy is correct;
no camera CTS regressions.
Bug: 32449509
Change-Id: I7a305b76b4f1d5c08b7938108bd73c95986508e0
CameraModule is already part of the HIDL wrapper and
is no longer needed in the service code.
Add extra logic in camera provder manager for identifying
camera API1 compatible devices.
Bug: 34392075
Test: Complete Camera CTS
Change-Id: I64a49e9091557c88859872d0c599c5be378db8b5
Make sure we don't keep any stale available callback buffer
references after recording stops. This can lead to resource
leaks.
Bug: 36478361
Test: Complete Camera/Camera2 CTS tests
Change-Id: I9f72b784ba3ae1cf9f9b16064a13b7ba8a1d0394
If the minimum duration of JPEG is less than the frame duration derived
from maximum fps, enable slowJpeg mode so that JPEG doesn't slow down
preview.
Cap the default max fps to 30 so that the switch between different
sensor modes can be minimized while still allowing the app to go higher
than 30fps.
Test: Camera1 CTS
Bug: 36692074
Change-Id: If4d367ac587c0f4d3620ca2d25063c5a12ebfceb
Different vendors could have different vendor tags.
A global vendor tag cache will store all available
vendor tag descriptors from different providers.
The cache will then be shared with each camera client.
Camera metadata will use specific vendor ids stored
in the metadata buffer to identify the correct vendor
tag provider.
Bug: 34275821
Test: adb shell /data/nativetest/cameraservice_test/cameraservice_test
--gtest_filter=CameraProviderManagerTest.MultipleVendorTagTest
Complete Camera/Camera2 CTS tests
Change-Id: I2262128f21a0167504f018230624e2a89786c467
Mark immediate zoom as not supported in case the camera has
maximum digial zoom close to 1. This will avoid corner
cases wehere we can have 'NUM_ZOOM_STEPS' all equal to 1.
Bug: 33093106
Test: Complete CameraTest CTS package
runtest -x cts/tests/camera/src/android/hardware/cts/
Change-Id: I039276385de74192375f36b1504dd89cb8ae0c52
AE/AWB lock availability is present in the camera static metadata.
Check whether they are supported before advertising them in Camera
Parameters.
Bug: 33091727
Test: Complete CameraTest CTS
runtest -x cts/tests/camera/src/android/hardware/cts/
Change-Id: I9a8cc8ffcc28b6b476904c3c011ab0ec65b162c9
Otherwise some bits aren't where they're supposed to be.
Also stop using HW_CAMERA_ZSL; we need to only set HW_CAMERA_READ, and it's
confusing to set a producer flag on the consumer usage side.
Test: Camera CTS passes
Bug: 35215313
Change-Id: I23e6e60bf875fe9d8f2d7a1f805d2ef854c16b97
Currently this path relies entirely on the deprecated bi-directional
streams. This needs to be re-worked and the functionality should
only use input&ouput streams. In this case the dedicated
'Camera3ZslStream' module becomes mostly obsolete. Some of the logic
for buffer comparison will still be needed and can be moved to ZSL
processor entirely.
The processor module will now use two streams, one input stream and
one ZSL output stream, which will produce the queue data. Both of
them will be configured to use the supported sensor array size and
private format. Scaling from the sensor resolution to the final user
requested size will happen during the re-process pass once image
capture gets triggered.
BUG: 34131351
Test: Manual via TestingCamera, 'CameraTest' API1 test cases
Change-Id: I7c87b7e7f89815e01a7cb5ce39d9c561c58562df
1. Disable the ZSL path for now
2. Add the missing provider version of initialize()
Test: All API1 CTS passing
Bug: 32991422
Bug: 34131351
Change-Id: I437a00db44c4fbb836875040fd4a91e1abbab734
- Add CameraProviderManager
- Enumerates individual camera provider HAL instances, as well
as the devices they provide
- Handles dynamic provider and device appearance/disappearance
- Maps device names to public API namespace
- Add unit tests for CameraProviderManager
- Add logic to enable new HIDL path
- Switch various bits of service internals to use string camera IDs,
though leaving most camera1-facing bits using int IDs, since that's
what the old API uses.
- Update CameraService to use CameraProviderManager instead of
the legacy camera HAL
- Update clients to pass through provider manager to devices instead
of just camera module
- Still TODO:
- Update Camera3Device to use new HIDL interface
- Update CameraHardwareInterface to use new HIDL interface
- Update dump()
- Update vendor tag handling
Test: New unit tests pass, camera CTS passes with Treble disabled
Bug: 30985004
Bug: 32991422
Change-Id: I7ac41f13b9501d5e53256e28c0465ec70aa3980e
Make handling of boolean properties more readable and consistent by
using property_get_bool instead of parsing the result of property_get
Change-Id: I8490d0f0b41a92eab5131e0aac0ecdf704a63381
The 'res' is uninitialized if params.state == Parameters::PREVIEW.
This sets the default value to 'OK' to silence this warning.
Bug: None
Test: Run clang-tidy on this code and the warning is gone.
Change-Id: I9d1b5e09c7957813f3c66d052c6a9f7d4b074b84
Some HALs may advertise slightly larger min frame durations, which
makes the supported fps check fail. Then, some supported fps range
may be missing in the supported preview fps range list.
Bug: 32544699
Change-Id: I1ed62b97d3d39e5d7f0e7c407c6cc482b8968373
The advertised supported preview fps ranges need to be supported
by all preview sizes. This change does the check to make sure the
API1 doesn't over-advertise its capability.
Bug: 32360340
Change-Id: Iccd13967305f1d0a62b89da87070591bfb973bbf
* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1
Change-Id: I71d3008da843ba5f1df1a73a320fb2af6ceffa16
Merged-In: I71d3008da843ba5f1df1a73a320fb2af6ceffa16
JpegProcessor::onBufferReleased is fired for both successful and failed
Jpeg captures, but only cares about the failures.
In success cases, onBufferReleased is always fired some time after
onFrameAvailable, and sometimes the thread scheduling pushes
onBufferReleased to be so late that preview restart has started, which
can cause a deadlock with onBufferReleased acquiring locks in the
opposite order that preview startup will.
To fix, move the JpegProcessor mutex acquire to only happen in the error
cases, in which case onFrameAVailable will not have fired, and the
camera state will still be STILL_CAPTURE, not STOPPED or mid-preview
startup.
Bug: 29524651
Change-Id: I3f103e070c3b39c38117b91824cd79c5dfc757ac
- Don't engage ZSL if picture size is too small
- Don't engage ZSL if picture size matches preview size
- Include ZSL choice in dumpsys
Bug: 29620318
Change-Id: Ie8e0c5a9e1ed9f177d701f22996c4c1f4b81a71e
Add new binder calls to pass video native handle so the video native
handle can be passed between 32-bit and 64-bit processes.
Remove problematic code that used IMemory to pass video native
handle because the sizes of VideoNativeMetadata are different in
32-bit and 64-bit processes.
Bug: 28403412
Change-Id: I3341b1812ecc41d61846bb72ca926ecb1674c9ec
After a device has been disconnected, should return consistent errors
to the caller if they invoke further device methods.
For API1, that's INVALID_OPERATION, and for API2, that's
ERROR_DISCONNECTED.
Change-Id: I0f3d889906a9818c0e03852702b146fd33c9e42a
Fixes: 27591189
Camera api1 doesn't have error notification if JPEG buffer is dropped.
Add retry logic to try again if such error happens.
Bug: 27074407
Change-Id: I646566c6ee5a064896b5a433d8e1797140f0d257
- Switch clients of camera devices to use new dataspace values
- For older HALs, map to legacy dataspace values
Bug: 27344373
Change-Id: Icabc345025383f987ef4472cd26182a580dc8b3c
Change Camera3Device to send partial results as soon as a
partial result is received from HAL so that 3A partial results
are not bundled.
Change FrameProcess to wait until all 3A states are received before
notify the client about 3A changes.
Bug: 17320166
Change-Id: I31a3e42081430ff4f7a482c4b2f1db272b8b2e4a
- Also fix error logging template inconsistency
- Also add a few error handling cases into camera2 NDK
to deal with previously-ignored error codes
Bug: 27149500
Change-Id: I8f1f4c72252dd48d652f24b595b642199f20c327
Workaround for b/27039775
Some camera device HAL v1 implementations expect that calling
preview_stream_ops->set_buffer_count resets the preview stream's flag
for whether any buffers have been queued up by the camera HAL, allowing
the HAL to dequeue all buffers in the stream again (instead of just its
own buffer count limit, which is lower).
The underlying buffer queue behavior has now changed, and that flag is
no longer reset on a change of buffer count, to support dynamic buffer
queue buffer count features.
To maintain backwards compatibility with HALv1 implementations that rely
on this implicit HAL interface behavior, add a disconnect/connect pair
to the set_buffer_count call, which will reset the dequeue flag, along
with all other preview stream parameters.
To maintain other parameters, cache them when they are originall
set (either by the HAL or by the higher-level camera client), and apply
them again after reconnecting.
Bug: 27039775
Change-Id: I9fa220b356715e7f8e48adc7acdffbfa598c329c
Modify StageFright's CameraSource to forward calling PID as
client PID when connecting to CameraService so CameraService
can check if the client PID has permission to use camera.
Change CameraService to check calling UID is trusted before
using the passed in client PID and client UID to verify permission.
Bug: 24511454
Change-Id: I4906ab73510e2c75714690bed675e3c13aca3ccf
The camera service may fail to release the camera hardware instance
in some use cases.
When an application unlocked the camera before disconnect, disconnect
from the application will not be accepted. And disconnect from media
server will not be accepted also. Then, the camera hardware instance
will not be released and a resource leak will be caused.
Allow media server to disconnect the camera at all times even if
the camera is unlocked.
Change-Id: Icd5ed81bed242fa5947aa40ca85e4ca7fa7286e7
Use a BufferQueue between Camera and StageFright to pass video
buffers for Camera HALv3 devices.
CameraSource in StageFright will try to use "buffer queue" mode
if it is supported by the camera device. In "buffer queue" mode,
CameraSource creates a buffer queue and a listener thread to recieve
video buffers from camera device. CameraSource then wraps the
ANWBuffer in MediaBuffer. If the camera device doesn't support
"buffer queue" mode, it falls back to "metadata in video buffer"
mode or "real YUV data" mode.
"Metadata in video buffer" mode is removed from Camera2Client and
only "buffer queue" mode is supported.
Bug: 24511454
Change-Id: Ice833b57bcd8d91852d6415402013f56f3e3970a
HALv2 only ever shipped with Nexus 10, and has been fully superceded by
HALv3. Remove it to allow for various code simplifications and cleanup.
- Remove Camera2Device
- Remove various special-case codepaths for supporting Camera2Device
- Remove CameraDeviceFactory, since it only creates Camera3Devices now
- Remove BurstCapture and associated CaptureSequence/Parameters code
- Remove old ZslProcessor and simplify ZslProcessor hierarchy to be
just ZslProcessor3, which is renamed to just ZslProcessor
- Add service-init-time check for unsupported device versions
- Fix assorted compiler warnings, some old, some new
- Remove references to HALv2 when possible
Bug: 25866588
Change-Id: Ia1063264d315f9b742ec5cdd0483539310894f5e
Meeting the condition
if (sceneModeOverrides.count !=
availableSceneModes.count * kModesPerSceneMode) {
results with ALOGE which describes the missmatch.
The description does not match the condition.
Signed-off-by: Hubert Rzezniczak <hubert.rzezniczak@gmail.com>
Send the camera proxy service in system server updates to
camera device state: opened/closed/active/idle.
Bug: 23393557
Change-Id: Id7c70f134821efa34af8f6e7b4caa4c2ab128ebc
If largest jpeg stream cannot sustain 30 FPS, don't
create jpeg stream until takePicture is called and remove
it after still capture is done.
Also, disable video snapshot for such sensors so video snapshot
won't slow down video recording.
Bug: 22231605
Change-Id: I2b34d2537c224694ae10f2006b5a46be45a1b1a6
Also switch use of ANativeWindow to Surface, to get to the
getConsumerName() method where necessary.
Surface can always be cast to ANativeWindow, but not the other way
around, so it's a better option anyway.
Change-Id: Ie5c2d30821c1a754f9e382699ff50b4b328288b3
- Support new set video format/dataspace command in camera service
- HALv3: Select gralloc usage flags based on format
- HALv1: Pass format command directly to HAL layer
- Use format/dataspace command in CameraSource
- Switch all API1 recording to use metadata mode
- Switch all >= HALv2 API1 recording to use kMetadataBufferTypeANWBuffer
Bug: 13222807
Change-Id: I2e609b92c65792611bb1dab09e0c41c363ebbc42
Previous implementation only notifies the callback when we receive
full capture result. This implementation notifies the callback
once HAL sends capture start callback.
Bug: 12530628
Change-Id: Ibf71d532b5cf649514b316e35683c217021698b4
Due to older HAL compatibility, we have been setting a tight crop region
that just bounds the current output streams. However, this did not take
into account any possible ZSL output stream, so correct application of
our stream cropping rules to ZSL results in double-crop scenarios, if
the ZSL stream aspect ratio does not match the aspect ratio of the other
output streams.
Since all current HALs follow the correct stream cropping rules (or
at least sufficiently ignore them for ZSL), simplify the cropping
substantially - now either calculate the crop region based purely
off the active array dimensions and zoom factor, or purely off
the preview stream and zoom factor. The former is used for setting
the request crop, and the latter is used for converting coordinates
for metering regions.
Bug: 20316691
Change-Id: I5a0bc2e7c09cf60fbae4220566540ca9e674d652
[Cause]
CallbackProcessor uses always same buffer to send preview data.
A buffer is written before it is read by user process.
[Solution]
Increment buffer index correctly.
Change-Id: I87a7e3dc6546448a419c96aa58ace3b7d086bf70