Commit graph

191 commits

Author SHA1 Message Date
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Jayant Chowdhary
48f3952ffc Documentation updates to camera HAL interfaces.
Bug: 124248114

Test: mm -j64

Change-Id: If1cf0e2d464ac62e5897b8faaf4835d06c12edd8
Merged-In: Ibc2415531a16e42ae81e33c3bdb28aca08e6a5fe
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2019-02-12 11:16:17 -08:00
Socrates Li
9ada649246 Camera: Document 3.4 metadata selection logic.
Bug: 119575429
Test: Ensure everything still builds.
Change-Id: I6500ab06b8c392310009ecfa0570000742fd069c
Merged-In: I6500ab06b8c392310009ecfa0570000742fd069c
(cherry picked from commit a5cbabbee9)
2019-01-22 13:46:57 -08:00
Shuzhen Wang
eaab6169b1 Camera: Clarify the FMQ read order for request/result
If there are more than one metadata entities being passed
via FMQ, specify the framework read order.

Test: Build
Bug: 119575429
Change-Id: Ia34ac69ce670b1ebeda12d92af490c347f33c15b
Merged-In: Ia34ac69ce670b1ebeda12d92af490c347f33c15b
2019-01-14 16:29:25 -08:00
Treehugger Robot
4ffb6e0bd8 Merge "Camera: Clarify configureStreams doc" 2018-12-17 22:47:12 +00:00
Chih-Hung Hsieh
65ab67312b Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I1b76a22eab100a31e77048626e48169fe7eeaf92
2018-12-17 19:57:21 +00:00
Shuzhen Wang
77c5c4e8b1 Camera: Clarify configureStreams doc
Test: Compile
Change-Id: Idbb7ed8f8dd0a1ebe1d5227446ec7170fec3ec4a
Merged-In: Idbb7ed8f8dd0a1ebe1d5227446ec7170fec3ec4a
2018-12-15 00:51:59 +00:00
Xin Li
5c60a30824 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: I9e51f516a0ff8cb197e9f3f927cae9e25328a1eb
2018-12-11 14:17:43 -08:00
Chih-Hung Hsieh
5daaea7cdc Fix implicit fallthrough warnings.
Test: make checkbuild
Bug: 112564944
Change-Id: Ib2b337146de86e4abe40ded5932196f1b8b698c6
2018-10-16 14:22:12 -07:00
chenhg
06ced051d9 Avoid segfaults if disconnect USB camera while preview.
BUG: 117575807
Test: manual test by disconnect USB camera while preview.

Change-Id: Ia74b03e7f2a672efd9e9dfd651b5894529daeeee
2018-10-12 14:17:04 -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
Steven Moreland
f5e4d7fb59 Update makefiles after native handle in Java.
Bug: 35098567
Test: N/A
Change-Id: I54b8d804e480cda09806f8028b966f28c4bd706e
2018-08-14 20:29:42 +00:00
chenhg
564cdae552 Camera: provide thumbnail size for more jpeg aspect ratios.
BUG: 110462045
Test: Camera CTS
Merged-In: I5f5500a5e4d02c3cbaa127cd9f222d241f047044
Change-Id: I5f5500a5e4d02c3cbaa127cd9f222d241f047044
2018-08-09 17:49:57 +00:00
chenhg
f2a6c47a9d Camera: allow to configure minimum stream size.
HW video encoder usually has limitation to encode very small
stream. Camera should avoid to return such streams to avoid
video encoding failure.

BUG: 110654511
Test: CTS android.hardware.camera2.cts.RecordingTest#testSupportedVideoSizes
Change-Id: I6104f2d4efcf7831d1dc6d305c82309e2fd1999d
2018-08-07 15:15:13 -07:00
Yin-Chia Yeh
7d1fdecea5 Legacy camera shim: add option to free buffers earlier
This option allows HAL to opt in for the behavior that will free
cached buffers earlier if the libhardware HAL implementation
doesn't cache/reference the cached buffers internally.

Test: buffers are freed earlier when the property is set
Bug: 111850884
Change-Id: I3a10b288c7160c86dc7d3a30d04b5c4903917731
2018-08-03 12:38:30 -07:00
Shuzhen Wang
a7a4f5bd8a Merge "Camera: Avoid Metadata re-allocation during shrinkCaptureResult" into pi-dev
am: 62e310cbfd

Change-Id: I3ef8040de1fbbf4239cb0e15e0a04f9fd0ec70b7
2018-06-06 09:41:53 -07:00
Shuzhen Wang
9b71bc20c4 Camera: Avoid Metadata re-allocation during shrinkCaptureResult
If capture result metadata is to be shrinked, reserve enough space so
that CameraMetadata isn't re-allocated when std::vector expands.

If vector expansion happens, CameraMetadata is re-allocated, causing
camera_metadata_t being re-allocated as well.

Test: Camera CTS
Bug: 109672123
Change-Id: Idaf5bf409bdbbccf617614edc96c0478260b4c30
2018-06-05 23:13:54 -07:00
Yin-Chia Yeh
7a83eaa56d Merge "Camera: add FMQ size override logic" into pi-dev
am: de680c0d0c

Change-Id: I84a2fdb5c00e976901a19c2089a944383d3d7536
2018-05-25 10:39:29 -07:00
Yin-Chia Yeh
9d32c13f0b Camera: add FMQ size override logic
Test: modify FMQ size in device.mk
Bug: 80242493
Change-Id: Ie1fb12118ad53c5bbe0cf264bffaafcd3728f8db
2018-05-24 10:53:57 -07:00
Yin-Chia Yeh
92cd88be57 Merge "Camera: use compact copy when necessary" into pi-dev
am: 918507685e

Change-Id: I059f2a746960ae1512647d5893074b15e7f2a20b
2018-05-23 14:22:56 -07:00
Yin-Chia Yeh
090872abcf Camera: use compact copy when necessary
When camera HAL sends redundant metadata (reserved space >> actual
used space), create a compact copy to save IPC overhead.

Test: Camera CTS/camera app smoke test
Bug: 79838637
Change-Id: I02657deb377c43c65d111d1fc894eb3c20ad3b8f
2018-05-23 09:43:03 -07:00
android-build-team Robot
cf20daebcb Merge "Camera: Set partial results in result batcher" into pi-dev
am: 33ad1e6aa1

Change-Id: I632f43b7e378ad1bda505d8c1f06a16f3c487868
2018-05-03 10:33:09 -07:00
Emilian Peev
59dd3df9eb Camera: Set partial results in result batcher
Camera device session 3.4 has a separate result batcher
instance. The partial result count needs to get initialized
in the same way as ver. 3.2 otherwise the frame batches can
get retired prematurely.

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

Change-Id: I36bfb5bc448154f80f4cb94edcfd119048361099
2018-05-03 13:36:49 +01:00
Steven Moreland
c90461c738 rename hidl_enum_{iterator,range}
This is actually a range, not an iterator.

Bug: 78573628
Test: m
Change-Id: Ie824a3eabcb7d5af94a8752e1498bdc8c7032e40
2018-05-02 00:06:33 +00:00
Yin-Chia Yeh
b0140796a3 Camera: check return value of callback
Test: no crash
Bug: 78181355
Change-Id: Iaf953045b64dd7b258cf49919ccb8aa5a8a0c7d1
2018-04-27 09:32:39 -07:00
Zhijun He
9b61e6197e camera: print the oversized result size
It's generally a bad thing to have the result exploded to exceed
the shared message max depth (1MB). Print the size when such case
occurs for better debugging output.

Bug: 77665564
Change-Id: I971fca202aa3ca0fa1863e9c658659d0775a1ad4
2018-04-06 18:44:42 -07:00
TreeHugger Robot
5d90142071 Merge "Camera: various external camera fixes" into pi-dev 2018-04-06 10:11:18 +00:00
TreeHugger Robot
aa91a992eb Merge "Camera: use finer lock in external camera OutputThread" into pi-dev 2018-04-04 13:45:39 +00:00
Emilian Peev
bc0e16519f Camera: Check external camera v4l2 buffer size
V4L2 buffer size should fall within a reasonable range
like (0. width*height*2]. Check and return appropriate
status in case the size is not within this range.

Bug: 72261912
Test: Camera CTS
Change-Id: I1945dc734afb552ecb8d4ef74c9198eca8ce00e7
2018-04-03 14:47:39 +01:00
Shuzhen Wang
448b7e398a Camera: Validate physical camera related metadata field from legacy HAL
Make sure that num_physcam_metadata, physcam_ids, and physcam_metadata
returned from process_capture_result is sane.

Test: LogicalCameraDeviceTest
Bug: 77218595
Change-Id: Ic4d9823569fb86b20ab2ab21edfc32a0e9f5c9c7
2018-03-29 23:34:51 -07:00
Nathan Harold
c893754c0d Update Makefiles Missed In Previous Commits
When calling update-makefiles.sh there are
some unrelated changes that were missed in
previous commits.

Bug: 8675309
Test: compilation
Change-Id: I5bf67fbcc809de36bde1869ada7b835566a5198b
2018-03-19 16:37:46 -07:00
TreeHugger Robot
ba20b76deb Merge changes I20310606,Ic23b7fb2 into pi-dev
* changes:
  Camera: more external camera CTS fix
  Camera: various external camera CTS fixes
2018-03-19 20:06:27 +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
Shuzhen Wang
17d817a889 Camera: Do not forward capture_result in error condition
If HAL calls process_capture_result with invalid buffers, the HIDL
wrapper shouldn't forward it to camera service, since the CaptureResult
structure may not be completely initialized.

Test: Run GoogleCamera
Bug: 74433802
Change-Id: Iaf20b542af5b11ffbedf709e99137b69d77a9ad3
2018-03-09 16:01:06 -08:00
Yin-Chia Yeh
94f52a39c2 Camera: use finer lock in external camera OutputThread
To avoid OutputThread waiting for mLock.

Test: CTS RecordingTest + systrace
Bug: 72261744
Change-Id: If387a1d4a2b0081c4bc43cb648a98e3706864f19
2018-03-07 14:46:51 -08:00
Yin-Chia Yeh
c15a1cab6f Camera: more external camera CTS fix
Also update default external camera config to prevent
over promising peformance on lower end devices.

Test: API2 CTS tests except RecordingTest
Bug: 72261744
Change-Id: I20310606520099abf0f5173690f4aaf56a3e52a9
2018-03-06 10:35:29 -08:00
Yin-Chia Yeh
8b699aaf37 Camera: various external camera CTS fixes
1. Update the FPS range to list (0.5*fps, fps) only
   as webcams tends to skip a lot of frames and not
   able to output at stable framerate.
2. Exif: don't expect focal length to present
3. Thumbnail: allow 0x0 size for no thumbnail output
4. Allow retry some ioctl during configureStream as
   some webcams seems having problem in quick close
   reopen operation.

Test: CTS CameraTest
Bug: 72261912
Change-Id: Ic23b7fb293b7579694c59240e854d750c842886d
2018-03-06 10:35:12 -08:00
Yin-Chia Yeh
e99cf209de Camera: add profiling traces
Bug: 72261744
Change-Id: I82e4d8ecc702c12bb7beb4f3d9979869ce6f4ac2
2018-02-28 16:00:28 -08:00
Yin-Chia Yeh
3aa9ae979c Camera: add external camera fps control
V4L2 doesn't seem to allow changing fps at runtime, so we need to
wait until pipeline is idle and reconfigure V4L2 streams.

Also update the fps filtering logic to make sure supported fps
are consistent as long as the major dimension is the same.
Ex: for 4:3 webcams, all 1280*N sizes has the same fps set, or
    for 16:9 webcams, all N*720 sizes has the same fps set.

Bug: 72261912
Change-Id: I534f09bebadb2f532a030a841633a8be7d3a87cc
2018-02-28 16:00:18 -08:00
Yin-Chia Yeh
8c76b8c465 Merge "Camera: avoid copying of HalRequest" 2018-02-21 21:53:22 +00:00
Yin-Chia Yeh
fa5aafbec3 Merge "Camera: implement external camera dumpState/close" 2018-02-21 18:34:22 +00:00
Yin-Chia Yeh
e086fb7b4a Camera: avoid copying of HalRequest
Bug: 64874137
Change-Id: I46ea14facf467921da633cde7e24ff9703a6a8f7
2018-02-20 16:28:55 -08:00
Yin-Chia Yeh
4a3393cd8a Camera: implement external camera dumpState/close
Also switch to v4l2 timestamp is it's MONOTONIC

Test: Cts CameraDeviceTest
Bug: 72261676
Change-Id: Iec82c254dcf16a56952ff8910d13c92782d48090
2018-02-20 16:28:50 -08:00
TreeHugger Robot
d477e1e092 Merge "Camera: implement external camera flush" 2018-02-16 18:58:57 +00:00
TreeHugger Robot
9c14496f2c Merge "Camera: Add support for empty physical settings optimization" 2018-02-14 20:25:38 +00:00
Yin-Chia Yeh
72eb5eea6b Merge "Camera: use rational/double for external camera framerate" 2018-02-14 18:31:02 +00:00
Yin-Chia Yeh
190e5601d6 Camera: implement external camera flush
Test: CTS abort capture test
Bug: 72261676
Change-Id: I0c3af8693a885672953ff394121c40c5ade59964
2018-02-13 18:52:42 -08:00
Yin-Chia Yeh
9eee6a9fd1 Merge "Camera: plumb external camera API1 support" 2018-02-13 22:35:06 +00:00
Yin-Chia Yeh
134093a43f Camera: use rational/double for external camera framerate
For better precision.
Ex: minFrameDuration of 30fps 333333334->333333333

Bug: 72261912
Change-Id: I830d694d34eb01426e46279c4c986d8879b9d847
2018-02-12 15:00:34 -08: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