Commit graph

49 commits

Author SHA1 Message Date
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
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
Steven Moreland
7e73d5b908 Remove viral dependency on libhwbinder. (2/2)
find hardware/interfaces -name Android.mk -exec sed -i -e '/libhwbinder
\\/d' {} \;
find hardware/interfaces -name Android.bp -exec sed -i -e
'/"libhwbinder"/d' {} \;
./hardware/interfaces/update-makefiles.sh

Note, automotive has some actual dependencies on libhwbinder, filed
b/35758626 for this.

Test: everything links
Test: (sanity) booted marlin on internal master with these changes
Bug: 35710429
Change-Id: I6d0726c8130d00684b978efbdd48e3ae396f12e5
2017-02-24 12:18:01 -08:00
Steven Moreland
a0da1a1c3d Move hidl shims to the vendor partition. (2/2)
We need google shims on the vendor partition because they are providing
an implementation of a vendor defined interface. They were written by
google just as a courtesy/to make the transition easier. They're
basically a set for vendors to assemble their hal implementations
from.

Bug: 34135607
Test: marlin persist.hal.binderization on/off
Change-Id: I2e2af5af39264cf290259755bb9b2eb9827a21f5
2017-02-13 15:03:41 -08:00
TreeHugger Robot
daa20b72c2 Merge "Camera: fix open_legacy crash" 2017-02-10 23:01:48 +00:00
Eino-Ville Talvala
0f5eb837fe camera.provider default: Don't stop init if vendor tags are bad.
And definitely don't stop init if there are no vendor tags defined at
all.

Instead, just log about it.

Test: gce camera HAL init succeeds; no regression to sailfish camera
Bug: 35036220
Change-Id: I7f4481d7ec1a88df0c67a66c364f351b3321b221
2017-02-10 22:04:27 +00:00
Yin-Chia Yeh
6dc9b53abe Camera: fix open_legacy crash
If the torch callback is fired during CameraProvider
constructor, the sp will cause it being deleted
when the callback returns.

Test: fix the crash
Bug: 35216523
Change-Id: I133d866ed603d6c7e549b57d20a911af7a7e0698
2017-02-09 23:10:57 -08:00
Yin-Chia Yeh
469c67b027 Camera: remove BINDERIZED flag
No longer needed. This also enable us to switch to
defaultPassthroughImplementation.
Also rename camera device wrapper library to signal it's not a
top level HAL entry.

Test: marlin camera app with passthrough/binderzied mode
Bug: 34817742
Change-Id: I78ad5afbf78b2679be3efe0e82f430958ef6bfea
2017-02-03 14:43:08 -08:00
Yin-Chia Yeh
e466fc9c9f Merge "Camera: add a missing hidl_cb call" 2017-02-01 08:47:59 +00:00
Yin-Chia Yeh
2cee1b38c8 Merge "Camera: call setCallback before open_legacy" 2017-02-01 08:47:27 +00:00
Yin-Chia Yeh
fca2e74209 Camera: call setCallback before open_legacy
Some open_legacy implementations require a valid callback.

Test: the failing open_legacy call succeeds
Bug: 34854786
Change-Id: I461c7622bdf46a7cb7febfb7eeeb083288b4af03
2017-01-31 17:40:23 -08:00
Steven Moreland
7fd6ad80ee Camera: work with vintf toggle.
Camera is currently compiled separately in passthrough and binderized
modes. Until that is resolved, adding a call to internal hidl logic.

Bug: 34817742
Test: camera starts up and works and respects binderization toggle in
both modes on marlin.
Change-Id: I20733cbc82a68a1da1c4f1b3754aef2887ca718a
2017-01-31 16:48:52 -08:00
Yin-Chia Yeh
ff0bc02a1c Camera: add a missing hidl_cb call
Test: no fatal error from calling get_device_1_0
Bug: 30985004
Change-Id: I6f1cfce903773d22ff5bb21a6db98d3f4ffa0697
2017-01-31 16:12:35 -08:00
Yin-Chia Yeh
10d6834e6d Camera: binderize camera hal
Test: running marlin in binderized mode
Bug: 30985004
Change-Id: I9c3ab3c445e437a8a8b6f271f3c475f60563f488
2017-01-20 12:26:41 -08:00
Yin-Chia Yeh
9c6dbd5979 Camera: patching treble camera HAL
Bug fixes like deadlock resolution, wrong enum usage etc.

Bug: 30985004
Test: run Camera2 API CTS tests on Angler
Change-Id: I661fa9197f66344ddecca8f68d343c891806eca1
2017-01-05 14:50:47 -08:00
Yin-Chia Yeh
f906b3bbbb Camera: Add default camera provider 2.4
Supports legacy camera HAL modules; also exports ICameraDevice
instances.

Test: compile
Bug: 30985004
Change-Id: I2b9624a412de95dd43979a5e6650b170010c577a
2017-01-05 14:48:27 -08:00