Partial revert of "Add __INTRODUCED_IN to audio/camera/media headers.",
commit 85a41536a4.
Restore the API guards where they used to exist. I *could* add
__ANDROID_API__ around only the function declarations, which is what the
versioner would do, but the function declarations are mixed up with the
types and constants, so I'd need to add a bunch of __ANDROID_API__ checks
or reorganize the headers.
NdkMediaFormat.h and AAudio.h still have __INTRODUCED_IN symbols that
aren't guarded by __ANDROID_API__. Maybe those files should be reorganized
so they don't alternate between APIs so much.
Test: builds
Bug: http://b/111668906
Change-Id: I757a6097f7840ea50e2fc92db7defef493097672
Exempt-From-Owner-Approval: cherrypick
(cherry picked from commit 0c9470cec2)
__INTRODUCED_IN only applies to function or variable declarations, not
a typedef to a function pointer.
Bug: https://github.com/android-ndk/ndk/issues/706
Test: builds
Change-Id: I472565d3e34e5c6a3cd88500ad03ef9ce4489c25
Exempt-From-Owner-Approval: cherrypick
(cherry picked from commit e0ec2e3fb2)
The orientation and facing of external devices cannot be used
for calculating the jpeg orientation.
Bug: 72261912
Test: Android compiles without errors
Change-Id: Ide8dcdb709dfb2c43a72241c9bf3f65af8d23d87
This allows camera devices to correct geometric distortion in their
optics, when requested by the application.
The correction only applies to processed (YUV, JPEG, etc) outputs,
not RAW buffers, or the result metadata.
Test: New CTS test passes
Bug: 74434422
Change-Id: I77a84c1321058ab6637be2fffaca19a27f46dca1
LENS_RADIAL_DISTORTION is inconsistently defined: in some places, it
is documented to operate on the range [-1...1], and in others, on a
range dependent on the camera lens's intrinsic calibration and focal
length.
Since fixing just the definition will not fix any existing devices
that define this value, deprecate the old key and add a new consistent
one to make sure applications only reference the consistent
definition.
Test: Adjusted camera CTS passes
Bug: 74641761
Change-Id: I5c9dea8653769696035c7d243fbd1fae4fd1b1cc
If application specifies 0-weight AF_REGIONS in capture request, the
camera device is allowed to override with non-0-weight AF_REGIONS in
capture result.
Test: Build
Bug: 29398609
Change-Id: I1e90c6c1717a894458b9a989cbd25981eaad43fb
- Include stdbool.h for using bool in C
- Add typedef to restore backward compatibility
Bug: https://github.com/android-ndk/ndk/issues/559
Change-Id: I28f5a99ea6271e364a2d1db793dbadcc63fe2f2c
The client API level should be part of the service proxy
notifications.
Bug: 68653614
Test: Manual using application
Change-Id: Id8a9fb51a8ba91795283c846b55a9343cf8505df
- Require timestamp source of logical and physical cameras to be the
same.
- Clarify requirement for guaranteed raw stream combinations.
Test: Compile
Bug: 64691172
Change-Id: Iaf5fe2721a7b21faf7a79b8db01a3df97b034ed5
- Add physical camera metadata in capture result.
- Adjust capture_result book-keeping for physical capture result.
- Adapt to new version of ICameraDeviceCallback.
- Batch physical metadata with logical metadata within one
process_capture_result call.
Test: testLogicalCameraTest CTS test
Bug: 64691172
Change-Id: I63fd343770cbb6183b7c6e4566c698f69801a8e8
Capture requests could include settings for different physical
cameras. Camera service should always check whether such
extended requests refer to valid physical devices and process
them accordingly.
Fix some stability issues in the camera native tests.
Test: Basic camera sanity using camera application,
camera_client_test, Camera CTS
Bug: 64691172
Change-Id: I68b81e983dd0b7caebfa03e4f0cf283f2a91dc7a
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
Change type to byte because int32 and enum cause type mismatch.
Allow DETECT in all AF modes.
Test: CTS
Bug: 64847201
Change-Id: I9c7b13f0fd53873b14e13eb5c85b421b588ced49
Currently the camera subsystem is trying to store all cameras, that
have ever been registered with it by camera HALs. This makes it
easier for the framework, but with hotpluggable cameras it makes
little sense, because for this HALs also have to store all cameras,
that have ever been plugged in and with every new plug in event
identify, whether this is a new camera or a known one. An easier and
cleaner approach is to remove cameras upon unplug. This patch
implements that.
Change-Id: Ie38cad59449386351518655e723e3f826a2ec826
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
If a UID is idle (being in the background for more than
cartain amount of time) it should not be able to use the
camera. If the UID becomes idle we generate an eror and
close the cameras for this UID. If an app in an idle UID
tries to use the camera we immediately generate an error.
Since apps already should handle these errors it is safe
to apply this policy to all apps to protect user privacy.
Test: Pass - cts-tradefed run cts -m CtsCameraTestCases
Added - CameraTest#testCameraAccessForIdleUid
Bug: 63938985
Change-Id: Ic0111d7c651b3d84c644b9f3d30e24133544f4fa
- MOTION_TRACKING capability defines a camera with accurate lens calibration
values, accurate timestamps relative to the inertial sensors, and ability
to limit exposure time to 20ms max.
- Add android.lens.poseReference for supporting gyroscope-centered lens calibration
data for MOTION_TRACKING.
Test: Builds
Bug: 63629224
Change-Id: I99f209afae930a7b59a2a84163d19de5f824cc96
The initial values of the session-wide capture parameters
should be passed along the stream list during stream
configuration. This could yield performance gains depending
on the Hal implementation and support.
Bug: 64450664
Test: Camera CTS
Change-Id: I2b0ec8916f027e7f34f81dc414c3ca649807e925
Put AIDL files into a filegroup so they can be imported as sources
for framework.jar.
Bug: 69917341
Test: m checkbuild
Change-Id: Ia500ff881bcc8d4a6f0aa66e12d9e6bb5a07ecc1
Merged-In: Ia500ff881bcc8d4a6f0aa66e12d9e6bb5a07ecc1
(cherry picked from commit 6bf135b03e)
Put AIDL files into a filegroup so they can be imported as sources
for framework.jar.
Bug: 69917341
Test: m checkbuild
Change-Id: Ia500ff881bcc8d4a6f0aa66e12d9e6bb5a07ecc1
Includes only minor formatting/wording tweaks from merging
together the SDK and NDK metadata definitions.
Bug: 29102963
Bug: 33262893
Test: Build and manual inspection of generated docs diff
Change-Id: Ie43e692cee5e6e7dc8de68c4191a9140bcc0025b
The Camera API needs to support the dynamic attach/detach of extra
output surfaces to a given camera stream.
Bug: 63912484
Change-Id: I18809aea31f78fb9e125bd18b58951ade4fad3c5
1. Fix AMessage contains last reference to session
issue
2. Fix disconnectLocked waits on dead session issue
Test: add some sleeps to make deadlock scenarios pops in CTS
and then run CTS 100 times.
Bug: 67965633
Change-Id: If0ab9e33de12969dcb5f1d10e96f47f13024f399
- 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
Bug: 33241851
Test: Enable BOARD_VNDK_VERSION and add libcamera_client as dep to
resolve camera/*.h file not found errors
Change-Id: I9ba45798a6e2ca7be96bf664f61c3bc1d0ef8d34
* Owners are selected from top CL approvals or owners.
They will be suggested to review/approve future CLs.
* OWNERS files are recognized by the new find-owners plugin, see .md files in
https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I7c848855a2d7a0d7f33123ea4ef5c2d03977b495
Modules exposed as source in the PDK should not depend on anything
under frameworks/base.
Bug: 62086238
Test: Validated PDK build no longer fails on libcamera_client
Change-Id: I5239f09693065378893a2305f403c185bb7d334f
Move libmediandk and libcamera2ndk headers into their module
and export them from there. Also move them to the same path
relative to the export as used in the NDK, media/ for
libmediandk and camera/ for libcamera2ndk.
Test: builds
Change-Id: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
Merged-In: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
(cherry picked from commit 7e8d4ba588)
Move libmediandk and libcamera2ndk headers into their module
and export them from there. Also move them to the same path
relative to the export as used in the NDK, media/ for
libmediandk and camera/ for libcamera2ndk.
Test: builds
Change-Id: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
(cherry picked from commit 7e8d4ba588)
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.
Test: links
Bug: 33276472
Change-Id: I1e33404a582a3707e0990634467c1fc7430c23a2
(cherry picked from commit 240b83a455)
For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG
template.
Test: make
Bug: 34689167
Change-Id: I5d793da299e3a6f01d3cac17a1ea2267274730f3
Test: verify that build has no failures
Change-Id: Ib249b276c6295e55eb54fa37b6d15486415dfbed
Merged-In: Ib249b276c6295e55eb54fa37b6d15486415dfbed
(cherry picked from commit 5f5ee1110d)
In preparation for moving libcamera_client to Soong, this is a backport
of the camera portion of the change to move headers from include/ into
the appropriate directories.
include/camera -> camera/include/camera
Adds a symlink from the old location to the new one.
Bug: 33241851
Test: mmma -j frameworks/av/camera
Change-Id: Ic508c2d0100f4e84b63e745d50eca1402b6fed6c
(cherry picked from commit d008fd1e4f)
For apps targeting SDK versions O and newer, the value of enableZsl
may be true in still capture template. the value of enableZsl is
always false for other templates.
For apps targeting SDK versions older than O, the value of enableZsl
is always flase.
Test: make
Bug: 34983527
Change-Id: I06b2a18254a78bd6505e9b6e6addc09ebf0f925f
Soong handles these automatically now.
Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Merged-In: I792e4647b38988db5d9f591d69688479ce9dc62b
Change-Id: I792e4647b38988db5d9f591d69688479ce9dc62b
Soong handles these automatically now.
Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Change-Id: I792e4647b38988db5d9f591d69688479ce9dc62b
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
Java strings are passed as UTF16 and attempt to pass cameraId
with alpha symbols via CameraStatus leads either to corrupted
or null strings.
Test: build/flash/boot
Test: verified together with ag/1841664 that alpha camera ids
are passed correctly.
Change-Id: Ic6045322137c156aa03bbcdccfe81f8f0ecb0618
Also, merge android.hardware.media.omx@1.0-impl into libstagefright_omx.
Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Manual use of Camera, Photos, Play Movies and YouTube apps.
Test: Manual use of screen mirroring.
Bug: 33854657
Change-Id: Ie927bcafd86dc7e9509bb8b76bb3b51f9a423cc7
Instead of a true/false switch for high-speed mode, use an integer
enum instead and define the two existing modes, plus the start
of a vendor mode space.
For all non-high-speed modes, use the normal configuration path,
but pass the operating mode to the HAL.
Test: New CTS test passes
Bug: 34853980
Change-Id: I9dc2b2a2164e9779f079a30e936c4117bcf96efe
Some interactions between camera service and hwservicemanager require
multiple threads to execute without deadlocks, such as calling
getService() from within an onRegistered() callback.
Increase thread count to 3 to accomodate.
Also switch the order of listener registration and legacy provider
addition back to what it was originally.
Test: No deadlock when camera service is restarted
Bug: 35096594
Change-Id: I6def961d5765958fef284c0a1820e903abc851ef
include/camera -> camera/include/camera
include/media/audiohal -> media/libaudiohal/include
include/media/AudioResampler*.h -> media/libaudioprocessing/include
include/media/Audio*.h,IAudio*.h,IEffect*.h,ToneGenerator.h -> media/libaudioclient/include
include/media/EffectsFactoryApi.h -> media/libeffects/include
include/media/stagefright -> media/libstagefright/include
include/media/nbaio -> media/libnbaio/include
include/media/<rest of files> -> media/libmedia/include
include/cpustats -> media/libcpustats/include/cpustats
Added symlinks from old location to new ones
Bug: 33241851
Test: VNDK linked modules will need to add explicit lib dep.
All other modules should compile the same
Change-Id: I0ecf754a2132640ae781a3cc31428fb8c0bd1669
A lot of media makefiles didn’t specify libui or
libgui but included headers from these libraries
directly.
It works because these headers are on the global
include path. With this change, though, rect.h
is not anymore (albeit exported from libui).
Test: built and booted device
Bug: 35164655
Change-Id: I72e8f0b7bd25c6a67eedc17afe52c4c484a147fe
If the server dies, the binder death callback clears out
the global camera service sp<>, and any current references to it
will become quite unhappy.
Test: Camera CTS passes
Bug: 31992879
Change-Id: I2966bed35d0319e3f26e3d4b1b8dc08006a22348
The test needs to make sure that all
necessary requirements for enabling the
framework-backed ZSL mode along the
API1->HAl3.x path are fulfilled. It should
then go through all supported picture
resolutions and try to take still
images in such conditions, that will
allow ZSL to remain active and process
frames from its own internal queue.
BUG: 34131351
Change-Id: Ife066397089abad94055e303e73e64abea038664
Add enableZsl key so the apps can choose to allow or
disallow out of order frame contents and metadata like
timestamp.
Test: Camera CTS tests on Marlin
Bug: 30983997
Change-Id: I715ef24ab55d6941c0ece16f09f325c26b83ea54
- Refactor the OutputConfiguration to contain isDeferred and isShared
flag, and not contain NULL surface.
- Unify the handling of deferred surface and shared surface.
Test: Camera CTS, and manual testing of GoogleCamera use cases
Bug: 33777818
Change-Id: I5dd3472f0f2133699b0e9fbdd8ba456956222746
The NDK CameraManager only lists cameras that support camera API v2. For
a device that only supports v1 the list comes back empty. This results
in allocating an array of size zero. This array was then intialized with
a nullptr. This is fine if the array contains at least one item but in
the case where there are no cameras this will cause a buffer overflow.
This change removes the initialization which fixes the crash.
Test: manual - ran camera CTS tests
Change-Id: Ie1c872ff66997d55572fd855f20b56bd58b01752
- Enhance OutputConfiguration to contain multiple surfaces for one
underlying stream.
- Create Camera3SharedOutputStream to handle streams with multiple
surfaces.
- Create Camera3StreamSplitter to handle buffer flows between camera and
multiple consumers.
Test: cts, and manually test camera preview/snapshot/recording
Bug: 33777818
Change-Id: Ia010c3cc9d9b4bd5b9ea03cc42fe4e0a0d8033f1
- 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
- For all camera2 paths, and anything shared between the legacy API and
camera2, switch to using strings for camera IDs
- Update ICameraService.addListener to return current set of known
devices and their status, to allow for immediate return of camera
devices when first connecting to camera service
- Remove unused code path for getCameraCharacteristics with HALv1
- Add namespace qualifiers to Binder objects that are also used by
hardware binder.
- Switch to using new HIDL DeviceStatus and TorchStatus enumerations
for better type safety in the service; map more clearly between
the HAL, service-internal, and Binder enums.
Test: cts-tradefed run cts -m Camera --skip-connectivity-check -d -o --abi armeabi-v7a --disable-reboot
Bug: 32991422
Change-Id: I765951d9a21000a8432bed9aa0e3604709daa4b1
Show the detailed error when we have it, rather than trying to show it
only when we don't.
Bug: 33358375
Change-Id: Ifa7a4f8de7b35a0379224efd1e27d6745844b853
This fixes Access to field 'targets' results in a dereference of a null
pointer
Test: the warning is gone.
Change-Id: If5d8c1c87c4cf77252bd5d262eefeba30c772fe7
Various media components were linking against dynamic libraries that weren't needed.
Test: built and booted
Change-Id: I7379506fd06d4e28e0eff0001fd073a2d3860f8e
Various media components were linking against dynamic libraries that weren't needed.
Test: built and booted
Change-Id: I7379506fd06d4e28e0eff0001fd073a2d3860f8e
onCaptureQueueEmpty is called when the non-repeating request queue in
cameraservice becomes empty. Application can use this callback as a
trigger for a new request.
Test: testMultipleCapture in PerformanceTest.java
Bug: 29006447
Change-Id: Id21afd74381e0b70f924c6026025c91a8ffd5ee0
On Android Wear devices we don't have cameras, so we don't need the
proxy service as well. If it is disabled by the system property, don't
wait for it to start, but rather return null pointer in
getCameraService(), which causes getNumberOfCameras() to report zero
cameras available.
The same logic applies to ACameraManager, where we return an empty list.
Bug: 28560707
Change-Id: I4c0bc29f061f1b66710c8188a7916bfaf089d23f
Don't re-implement the native unparceling of Surface, that's
what view::Surface is for.
Bug: 31162160
Test: Camera CTS passes
Change-Id: I31eae73ba08d820e4b17f2bcd3867d8f4473d68f
* 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
If multiple writepids, all must be in one line to take effect. Else,
only the last one will take effect.
bug: 30192722
bug: 28312446
Change-Id: Icbcdefec58346d5c7258b51055de96ec8de8dd65
Add new -m dumpsys option to cameraservice dump for monitoring
changes in selected metadata values in requests and results.
This option takes a comma-separated list of metadata keys, or the
shortcut value "3a", which expands to all the "android.control" tags.
In subsequent dumpsys calls, the last 100 changes to the tags being
monitored are listed.
The monitoring must be turned on once the camera device is running.
Bug:
Change-Id: If8938b30611ccafa86c2c4a06e57fc72680f827b
The cameraserver doesn't need access to media, drm, etc, to
operate.
Leave drmrpc as it is required for JPEG encoding support on some
devices.
Bug: 28915212
Change-Id: I61c96739eafbb3e55be7e646390d74bd5e71a842
cameraserver should be running in the camera-daemon cpuset, as it may
have different requirements than the foreground cpuset.
Change-Id: I1d201521a58a470497f762abd105609acf5fc02f
am: 40687b3ab4
* commit '40687b3ab422020d1fd1e7acf4042590d649c385':
CameraNDK: fill in more NDK API documents
Change-Id: I59ff1a94bb7a5e21140a675e89e84a65bf85238a
am: b7444b1d60
* commit 'b7444b1d60b72f17e9627b3fe0d0af1a980e4d97':
CameraNDK: fill in more NDK API documents
Change-Id: I84ed3651471a9bfa7357682ef164d5ca83dd6461
am: b7444b1d60
* commit 'b7444b1d60b72f17e9627b3fe0d0af1a980e4d97':
CameraNDK: fill in more NDK API documents
Change-Id: Ie775b8cefc79b6c2c76ca90d9ba4e2948eb6d069
This change adds document for ACaptureRequest, ACameraMetadata,
AImage and AImageReader.
Bug: 27102995
Change-Id: I79d88f73258c01ebeabcd5b4e3b90996759cb021
This change adds document for ACameraManager, ACameraDevice and
ACameraCaptureSession.
Bug: 27102995
Change-Id: I5706337e419cd533c1c7d46e412dc62bf7c726cb
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
Stop repeating request if any of its output stream is abandoned.
Add a callback to notify the repeating request has been stopped
with frame number of the last frame.
Update NDK with the new callback and behavior.
Bug: 21270879
Change-Id: I3553775c7807a77104aa1650609480ca3321310c
- Codegen update: some of hidden metadata keys should not be
disclosed in NDK.
- Also added capture result frame number plumbing.
Bug: 27102995
Change-Id: Ia238f95a4da726330205c53fc5d3f1f63d7553a1
Fix error handling regressions from the Binder interface refactor
- Error codes from openLegacy became incorrect
- Client initialize() call error codes were not discriminated between
Bug: 27657269
Change-Id: I2379d45d5fe5c2ad43c78bcfd18ea4c833adc987
- 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
If the video buffer contains a native handle, serialize and
deserialize it properly.
Author: spodder@codeaurora.org
Bug: 26268807
Change-Id: I1905be81e2045667e00c95ab75d1bf144756b894
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