Commit graph

182 commits

Author SHA1 Message Date
chenhg
a7d82e577a Camera: provide thumbnail size for more jpeg aspect ratios. am: 564cdae552 am: 737cfdf4db
am: 7aa4b087f2

Change-Id: If90e3d059563d514fb69f69854739733542da691
2018-08-09 12:03:35 -07: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
781743b4b5 Merge "Camera: allow to configure minimum stream size." am: c2f3b0bcf5 am: 8050b86a96
am: 30faec33a0

Change-Id: I3aa078a9818403d68b212f5a961b252f2c329308
2018-08-08 11:57:57 -07: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
96ab6781f5 Legacy camera shim: add option to free buffers earlier
am: 7d1fdecea5

Change-Id: I175ecfd4334849886252f9d6fb29aa16f9cfb500
2018-08-03 16:10:11 -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
Eino-Ville Talvala
0a2a9fc18c camera.device@3.4/metadata@3.3: Revise MOTION_TRACKING capability
Simplify the API for the P release

- Remove new templates
- Update docs
- Also update some metadata docs from prior changes

Test: Revised Camera CTS passes
Bug: 63629224
Change-Id: I47fb170052cf6062955278ace624a91e8a0078b3
2018-02-12 11:29:25 -08:00
Emilian Peev
e0c52bb1f0 Camera: Add support for empty physical settings optimization
Empty individual physical settings should be allowed after
one initial successful request.

Bug: 72524845
Test: run vts --skip-all-system-status-check --skip-preconditions
--primary-abi-only --module VtsHalCameraProviderV2_4Target -l INFO

Change-Id: I18d22a56f5f0e6e1d81a6e8c844697c02bc343a1
2018-02-09 20:19:36 +00:00
Yuriy Romanenko
9cdd6f9516 External: Switch to legacy V4L2 buffer mapping
Required for older kernels like 3.x

Change-Id: I0680320b606727bdb0b22dab1df8c5954d623f10
2018-02-06 21:39:59 +00:00
TreeHugger Robot
fe1192ecfc Merge "External camera: add device config file" 2018-02-06 21:35:15 +00:00
TreeHugger Robot
8f8e3b2e11 Merge "camera: Update multi-camera capture VTS case" 2018-02-05 21:13:23 +00:00
Yin-Chia Yeh
1e08966178 Camera: fix external camera FD double close
Release fence close was handled by freeReleaseFences so
hidl_handle should not own the native handle.

Test: running external camera on marlin
Bug: 64874137
Change-Id: I68e76d31985380eb3c502276df07d3648f67b6f1
2018-02-02 16:00:29 -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
Emilian Peev
6c87861cf6 camera: Update multi-camera capture VTS case
Individual physical camera requests should only be allowed
in case the respective physical Ids are among the last
configured Hal streams.

Bug: 72524603
Test: run vts --skip-all-system-status-check --skip-preconditions
--primary-abi-only --module VtsHalCameraProviderV2_4Target -l INFO
Change-Id: Ia5715398f74f03528d7fe2e52e5b9e32ad654a2c
2018-02-02 08:36:12 +00:00
TreeHugger Robot
4c5bfc6979 Merge "Camera: add buffer size to Stream" 2018-01-30 06:05:25 +00:00