Commit graph

64 commits

Author SHA1 Message Date
Eino-Ville Talvala
d1ce4e664a Camera: Centralize OWNERS
Test: Builds
Change-Id: I9b8d1675566db44b959c633c25ceaf61a6dc08db
2019-03-13 15:15:45 -07:00
Eino-Ville Talvala
2951804146 Camera: Restructure default camera.provider 2.4
To allow for implementation inheritance of @2.4 legacy wrapper and
@2.4 external webcamera HALs in the @2.5 implementations, restructure
the existing default provider to separate the service interface into a
thin shim that calls the implementations.

Test: Camera starts as usual after refactor, VTS tests pass
Bug: 121379978
Change-Id: Id40790ed4fb495577fd2b885c706b2ed7a96d64e
2019-02-07 16:20:35 -08:00
TreeHugger Robot
0a742a0409 Merge "Camera: support libhardware camera device 3.6" 2019-01-30 19:24:31 +00:00
Yin-Chia Yeh
c2d3d1ddb5 Camera: support libhardware camera device 3.6
Add buffer management API support.

Test: VTS to be written. Need Pixel device impl to verify.
Bug: 120986771
Change-Id: Icdbc621f8cd17aa0868d3ac361867c44793a268c
2019-01-28 11:22:15 -08:00
Shik Chen
758f4bb127 Camera: Enable external camera handling in default provider.
* The sCameraDeviceStatusChange() callback might be fired between
  initialize() and setCallback(), which can be easily triggered if there
  is an external camera connected at the boot time.

* The external cameras need to be excluded in the getCameraIdList().

Bug: 77833131
Bug: 122800852
Test: Reboot with an external camera is connected, and see the
      camera list is corrected probed in
      $ android-sh -c 'dumpsys media.camera'
      The testing device is Nautilus (Samsung Chromebook Plus).

Change-Id: I5cec6732ce4e26632f1bb5186331b7ce7a94a0b3
2019-01-26 05:18:46 +08:00
Peter Kalauskas
0b35cb2591 Add new lazy service target to default camera HAL
Test: On walleye_svelte, reboot device and check that camera HAL is not
      running until camera app is opened
Bug: 79374634
Change-Id: Ib9968c899ce8be5a68a28b4decf0a52f96b20ec5
2018-12-07 15:43:11 -08:00
Yin-Chia Yeh
ee23840bf8 Camera: add external camera@3.5
External camera@3.5 supports the new buffer management
API that allows HAL to request buffer when needed to
optimize the memory usage.

Test: smoke test TestingCamera
Bug: 109829698
Change-Id: Icfbb75a26d8e92e4eb82a680e94e183041a5174d
2018-11-15 10:23:08 -08:00
Yin-Chia Yeh
ccc05ec9b7 Camera: update camera HAL owners
Add OWNER file to device 3.5 default implementation and
add new owners to existing owner file.

Test: N/A
Bug: N/A
Change-Id: I09bae8a6bbdf48bd27cba8675d979c65b51a3e6b
2018-10-16 08:47:03 -07:00
Yin-Chia Yeh
6a6fe0f47b Camera: new buffer management HIDL APIs
No actual implementations yet.

Test: compile, new VTS to be written
Bug: 109829698
Change-Id: Ibe509dd743a84b147fdfed6599d8f066adb8793b
2018-09-27 11:13:13 -07:00
Shuzhen Wang
d3feb3d62c Camera: Add support for physical camera characteristics query
- Add version 3.5 for ICameraDevice for physical camera characteristics
query.
- Add version 3.5 for ICameraDeviceSession to work around HIDL
versioning bug.

Test: Camera CTS
Bug: 79523700
Change-Id: I8df6cdd4ee6ac5755758510c0dc1ea1cec31aa73
2018-09-13 09:25:34 -07:00
Yin-Chia Yeh
bbc046ed67 Camera: support torch control on external camera
Claim torch API support though there is no device
actually has a flash unit. This is to workaround
an issue in camera service where it falls back
to legacy camera HAL1 control if the device does
not report torch API support (and external camera
HAL does not implement HAL1)

Test: CtsVerifier FlashLight test
Bug: 113336515
Change-Id: I945b35fecfed3b2698b1e9bb1d8faad8699258d2
2018-08-28 11:22:51 -07:00
Kourosh Derakshan
68995cb341 camera: Adding 64-bit version of Camera Provider
Added a secondary Camera Provider for 64bit HALs

Test: GCA and normal camera usecases, CTS
Bug: 73173997
Change-Id: I2d9b9a916edc71b73086375f541368b080f5eca9
2018-05-12 02:08:53 +00:00
Jaekyun Seok
0fb4577a35 Add "vendor." prefix to ro.camera.wrapper.hal3TrebleMinorVersion
Vendor-specific property should have "vendor." prefix.

Bug: 36513925
Test: succeeded building and tested with taimen
Change-Id: I80f17fb6b8017a761122ddd2f8863e63c72e5623
2018-04-12 09:31:30 +00:00
TreeHugger Robot
5d90142071 Merge "Camera: various external camera fixes" into pi-dev 2018-04-06 10:11:18 +00:00
Yin-Chia Yeh
2d61bfd2b0 Camera: various external camera fixes
1. Add EXIF MAKE/MODEL tag
2. Add retry loop for V4L2 open failure
3. Do not add external camera if ExternalCameraDevice cannot be
   initialized

Bug: 72261912
Bug: 72569850
Change-Id: I06df1fbbb4afabea1a9a74aca9e288b24966cb0b
2018-03-14 14:19:35 -07:00
Yin-Chia Yeh
0d72ef929f Camera: external camera VTS fixes
Test: VTS pass for external camera
Bug: 72261912
Change-Id: I4f1da37081d0b8c1519ecc0ecc0cc6c3850ee2bb
2018-03-13 17:41:33 +00:00
Yin-Chia Yeh
1798249b8f Camera: plumb external camera API1 support
And also some refactoring to unify external camera
config file logics.

Bug: 72261912
Change-Id: If83d779c57540809bdaa58a5a32cf4ade734fafe
2018-02-12 12:16:23 -08:00
Yin-Chia Yeh
53f4cb140a External camera: add device config file
Also remove sizes cannot be cropped from maximal
size.

Bug: 72261897
Change-Id: Icb50cfa58a12e80be3cacc49569fac90be03c8e5
2018-02-02 11:50:56 -08:00
Yin-Chia Yeh
ab4502c707 Merge "Camera: Add external camera provider" 2018-01-23 02:54:27 +00:00
Guennadi Liakhovetski
6d2d1307e6 Merge "camera: add support for camera removal" am: cf99978291 am: 040c21f6c8
am: 3724fbedef

Change-Id: Ic32fd930f90515a74d1e44e4a3e932d20d7970ff
2018-01-23 02:52:28 +00:00
Yin-Chia Yeh
1903059507 Camera: Add external camera provider
Bug: 64874137 63873538

Change-Id: I4309874a7dedd3dd71d4bd0c2004d460421db679
2018-01-22 17:04:28 -08:00
Guennadi Liakhovetski
eca1d45ba7 camera: add support for camera removal
Add camera removal support to CameraProvider and CameraModule.

Change-Id: I047e486d1665ba9e0b1455f77a7bbbb5e0d66653
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
2018-01-22 12:01:08 -08:00
Guennadi Liakhovetski
e56eafc61d Merge "Camera: Fix hotplug" am: d7a0f2984d am: 78d88380d3
am: 99aaf673c5

Change-Id: I3e9566c4960c9f11376c7b0c8f377f9ccc1ac1ac
2018-01-18 20:20:55 +00:00
Guennadi Liakhovetski
7b7ede7ebd Camera: Fix hotplug
According to the camera_module_t::get_number_of_cameras() description
in camera_common.h, it should only return the number of "fixed"
cameras, i.e. cameras, facing to the front and to the back. Any
cameras, with the facing value of "external," i.e. externally connected
cameras, should not be reported by it, instead they should later be
reported, using the
camera_module_callbacks_t::camera_device_status_change() callback.
However, this doesn't work. When a camera is reported this way, it is
ignored as unknown. Fix this by adding a new camera, when its status
change is reported.

Change-Id: I18874ed005f477e32fb723c00c16b67a81cde6ce
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
2018-01-04 11:42:27 +01:00
Emilian Peev
e18057b42f Camera: Bump device version to 3.4
Camera devices supporting version 3.4 will be able to receive
session parameters during the stream configuration phase.

Bug: 64450664
Test: Camera CTS
run commandAndExit vts --skip-all-system-status-check
--skip-preconditions --primary-abi-only --module
VtsHalCameraProviderV2_4Target -l INFO

Change-Id: Ifd83bfe0e512fe75b63602b4aba98f4cc1cdeb53
2017-12-20 10:44:11 +00:00
Eino-Ville Talvala
7fccf50db2 Merge "Camera: Add default implementation of camera.device@3.3" into oc-mr1-dev am: 3f55d8735e
am: d69e27a115

Change-Id: If3fe372f0574c318fb194dcab0ea2cee4fc827ff
2017-09-19 16:01:04 +00:00
Eino-Ville Talvala
50fe430994 Camera: Add default implementation of camera.device@3.3
Inherit as much as possible from camera.device@3.2

- Refactor CameraDeviceSession@3.2 implementation to separate out the
  HIDL session interface from the main implementation object. This
  avoids multiple inheritance issues
- Create CameraDeviceSession@3.3 with support for the new
  overrideDataspace field
- Add virtual factory method for CameraDevice to create the right version
  of Session.
- Create CameraDevice@3.3, which overrides createSession to return a
  CameraDeviceSession@3.3.
- Add system property to override selection of which minor HIDL
  version is used for legal HAL version 3.x; set the default to the
  newest available minor version.

Test: Camera CTS passes on device using @3.3.
Bug: 62358514
Change-Id: I497e4bc0de798b56ecdb2ea6467b79afccaf89f7
2017-09-15 11:08:48 -07:00
Jaekyun Seok
81104ae5ef Add 'vendor.' prefix to a vendor HAL service name
To prevent property name collisions between properties of system and
vendor, 'vendor.' prefix must be added to a vendor HAL service name.
You can see the details in http://go/treble-sysprop-compatibility.

Test: succeeded building and tested on a walleye device
Bug: 36796459
Change-Id: I4e8fbee791ec917a8f627a1366f4d44ec7e6febc
2017-09-12 08:01:42 +09:00
Yin-Chia Yeh
feb0ddde26 Camera: add camera owners
Test: none
Change-Id: I1a221feea480139d78c9b10dcd6c7c88955901bd
Merged-In: I1a221feea480139d78c9b10dcd6c7c88955901bd
(cherry picked from commit 14a5810a2e)
2017-07-27 18:21:51 +00:00
Yin-Chia Yeh
14a5810a2e Camera: add camera owners
Test: none
Change-Id: I1a221feea480139d78c9b10dcd6c7c88955901bd
2017-07-25 13:54:51 -07:00
Martijn Coenen
ab97cef29e Merge "Start processes that need real-time with CAP_SYS_NICE." into oc-dev am: 6c062f77c1
am: b05e4c9414

Change-Id: I9fa6d2b4283ca50506ffcc6a665e6a2e46c4c2f9
2017-05-11 01:36:26 +00:00
Martijn Coenen
6c062f77c1 Merge "Start processes that need real-time with CAP_SYS_NICE." into oc-dev 2017-05-10 17:55:47 +00:00
Eino-Ville Talvala
1ad8ad8986 Merge "Camera: Clean up TODOs that aren't going to be addressed." into oc-dev am: 0b3d86e05a
am: e643da4e19

Change-Id: Ie8227d2db1667e60421ff88a65555260b426e16e
2017-05-09 23:16:57 +00:00
Martijn Coenen
f9b3fb49df Start processes that need real-time with CAP_SYS_NICE.
Bug: 37293077
Test: verified CAP_SYS_NICE granted in /proc/pid/status
Change-Id: If404450cbeb077d331b231bda1af2d6eae774b75
2017-05-09 09:57:00 -07:00
Eino-Ville Talvala
e0a0a1c239 Camera: Clean up TODOs that aren't going to be addressed.
These TODOs aren't in scope for the wrapper libraries.

Leave the few TODOs that have bugs tracking them, and the ones that
are from autogenerated metadata.

Test: Builds
Bug: 34108979
Change-Id: Ib28467a4fbcfaab4a0809334bc62eabb9290797a
2017-05-08 15:29:28 -07:00
TreeHugger Robot
ce9c1a6e62 Merge changes from topic 'fix_mess'
* changes:
  Revert "Revert "android.hardware.camera.provider@2.4: set up /dev/vndbinder""
  Revert "Revert "composer: route binder traffic over vndbinder""
2017-04-29 06:55:04 +00:00
Martijn Coenen
ca4c2c2226 Revert "Revert "android.hardware.camera.provider@2.4: set up /dev/vndbinder""
This reverts commit e6bc672921.
Test: marlin boots, camera works
Bug: 37302783

Change-Id: I73eb18d56020e345a0e2d6e90961512281de6644
2017-04-28 22:04:24 +00:00
Yin-Chia Yeh
feddd45722 Merge "Camera: use gralloc mapper for handle import" into oc-dev am: 02b745ff40
am: 8c0e9f19b2

Change-Id: Ie14587977306c05f1458cb47b6cc2d5c3f152f39
2017-04-28 02:16:01 +00:00
Emilian Peev
e7b05b0037 Merge changes from topic 'device_version_cleanup' into oc-dev am: 3176e6ebb9
am: 5649a3df94

Change-Id: I51b149bbec59f6e5bd7c9e8c865796a6a9ae96ad
2017-04-28 00:53:07 +00:00
TreeHugger Robot
02b745ff40 Merge "Camera: use gralloc mapper for handle import" into oc-dev 2017-04-27 23:00:50 +00:00
Yin-Chia Yeh
519c1675c3 Camera: use gralloc mapper for handle import
Bug: 37540361
Test: marlin, smoke test GCA
Change-Id: I9d58d9c6af20b37c016f036bce2dcf55817c59aa
2017-04-27 14:11:07 -07:00
Emilian Peev
c9ded51848 CameraProvider: Check camera device version
Make sure we are working with supported devices.

Bug: 34392075
Test: Manual using application
Change-Id: I834612303f3e02e79924efbdcc25cff890defefb
2017-04-25 20:05:41 +01:00
Trevor Bunker
e6bc672921 Revert "android.hardware.camera.provider@2.4: set up /dev/vndbinder"
This reverts commit b4488af17c.

Bug: 37302783
Bug: 37301743
Test: device boots to UI
Change-Id: I184ccb02c2dc188a7ff8ebb6256b2f6e72376758
2017-04-13 09:52:23 -07:00
Iliyan Malchev
b4488af17c android.hardware.camera.provider@2.4: set up /dev/vndbinder
The camera-HAL implementation may need to communicate with other vendor
components over /dev/vndbinder.  Route all libbinder traffic to that
node.

b/36651814
b/36651237
b/35870313
b/36683636

Test: sailfish

Change-Id: I9b80fefbcdf5ce18a2d788e8582ea8791a604435
Signed-off-by: Iliyan Malchev <malchev@google.com>
2017-04-13 00:24:39 +00:00
Andreas Gampe
0b171f1ff2 CameraProvider: Refactor legacy name regex code
The match will use iterators that will be invalidated when the
used string input goes out of scope. Refactor the API to return
the two components of the match.

Bug: 36871785
Test: m && m SANITIZE_TARGET=address
Change-Id: I2418541234a09e53856ea61e0fbc4b67d8036308
2017-04-05 10:34:04 -07:00
Yin-Chia Yeh
12b364bf8a Camera: HAL1: remove libbinder usage
Test: Angler HAL1 preview/takePicture/record
Bug: 35887419
Change-Id: I6cb37fd78a2fad1ee3b24e4cd61e3a3b2bce4744
2017-04-01 13:19:46 -07:00
Eino-Ville Talvala
b439b10d60 camera.provider@2.4: Legacy wrapper: Run with more threads.
Each concurrent camera device in use needs 1 thread to maintain
operational semantics, plus we probably need threads for sensor service
calls, misc camera service calls, etc.

Up thread count to 6. That should be enough for everybody.

Test: Camera still works on sailfish
Change-Id: I2262c69985756fbf762034663ce24f45bf7ce2f1
2017-03-17 13:37:01 -07:00
Shuzhen Wang
efb7bfa993 Camera: Provider: Set up vendor tag before getDeviceVersion
getDeviceVersion calls get_camera_info, which could contain vendor tags.
As a result, we need to set up vendor tag before that.

Test: Verify vendor tag in static metadata works.
Bug: 33641150
Change-Id: Id4cfea52235542b19170a757b4c6bea3ad1d190d
2017-03-15 18:35:42 -07:00
Steven Moreland
48c52249e4 hidl_default to all targets.
find hardware/interfaces -type f -not -path "*/.git/*" \
-exec sed -i -e '/cc_[A-Za-z_]\+/ { N; s/$/\n    defaults:
\["hidl_defaults"\],/ }' {} \;
./hardware/interfaces/update-makefiles.sh

Test: pass
Bug: 35840847
Change-Id: If10c464d2f000b85c8d698fe11a4f3fc4cfad282
2017-03-08 19:31:53 -08:00
Yin-Chia Yeh
248ed700fe Camera: default implementation of device 1.0
Also some updates to HIDL interface:
  - Add releaseRecordingFrameHandle to ICameraDevice
    for native handle metadata recording mode
  - Add handleCallbackTimestamp to ICameraDevieCallback
    for native handle metadata recording mode
  - Add missing face detection metadata to
    ICameraDeviceCallback::dataCallback
  - Instead of passing native handle, pass buffer ID
    in dequeueBuffer/enqueueBuffer/cancelBuffer in
    ICameraDevicePreviewCallback
  - Add CameraFrameMetadata in types.hal for face
    metadata

Test: Camera CTS passing (except FlashLightTest) on Angler
Bug: 30985004
Change-Id: Idf72a4b5f4c934845ac698f0b13536608ffd0100
2017-03-01 22:24:39 -08:00