Commit Graph

15 Commits

Author SHA1 Message Date
Sergii Piatakov
de617f0677 camera: fix -Wunused-function compiler warnings
Test: add `USE_CAMERA_V4L2_HAL := true` to
      hardware/libhardware/modules/camera/3_4/Android.mk and build
      mmm hardware/libhardware/modules/camera/3_4
Change-Id: I96926932e7b11230d6c22fb081a89946f670511e
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:39:32 +03:00
Sergii Piatakov
1bd0addfc9 camera: fix -Wreorder compiler warnings
Test: add `USE_CAMERA_V4L2_HAL := true` to
      hardware/libhardware/modules/camera/3_4/Android.mk and build
      mmm hardware/libhardware/modules/camera/3_4
Change-Id: I02cbe738fb7484e3a1d55712b0f0a55037e181e1
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:37:02 +03:00
Sergii Piatakov
2ad591f9ea camera: fix -Wmacro-redefined compiler warnings
Test: add `USE_CAMERA_V4L2_HAL := true` to
      hardware/libhardware/modules/camera/3_4/Android.mk and build
      mmm hardware/libhardware/modules/camera/3_4
Change-Id: Ida00d842007e2a589907bc4fd1887076fd8b5b2a
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:16:05 +03:00
Prashanth Swaminathan
28e0f76353 v4l2 camera: port ARC++ image processing code
Utiltizes ARC++ image processing code to perform the conversion between
the camera format and the requested format from the framework. In order
to support USB devices which may not implement the required formats,
conversion between YUYV/MJPEG to the request format is done on-the-fly.

TEST: All existing unit tests pass. Tested manually with the camera
sample APK, preview/video/capture in both JPEG and YUV formats. Tested
on the RPi v2 Camera, the Logitech C270 and the 180 degree Fisheye USB
camera.
Bug: 37708856, Bug: 69983918
Exempt-From-Owner-Approval: This HAL is owned by AT team.
Change-Id: I1a54581d1170fa3270036ec366fb613fe587a094
2018-01-10 12:39:23 +09:00
Jaesung Chung
6e8afead53 Override HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED during setuping streams
This CL makes the hack(ag/3176281) in frameworks/av not needed no longer.

Bug: 69321320
Test: After reverting the hack in av, the camera sample app works.
Exempt-From-Owner-Approval: HAL is owned by Things team.
Change-Id: I510531bed401fe4fa6071fc151a1f75307a5decb
2017-11-16 02:30:38 +00:00
Jaesung Chung
1fc9b614b8 Fix lock mechanism in v4l2 camera HAL
Both in_flight_lock_ lock in v4l2_camera.cpp and buffer_queue_lock_ in
v4l2_wrapper.cpp have problems that guards the buffer indices and in
flight buffer vector incorrectly. Those problem leads to mismatching in
terms of buffer size between the HAL and Camera3Device and eventually
the Camera3Device will stop to wait for buffers that HAL will not post
in the future.

Bug: 69076261
Test: Camera samples app doesn't stuck with FB impl.
Exempt-From-Owner-Approval: got +2 from the HAL maintainer.
Change-Id: I3d0a4361d46571fd144a5eb8bc160296a31d6358
2017-11-13 02:25:48 +00:00
Ari Hausman-Cohen
ef52310613 Correctly process streams
The reference implementation stream validation/setting
was all out of whack, particularly the handling of "reuse"
streams. This CL does away with that, and plugs in the
static_properties/request_tracker validation/tracking of
configured streams.

Implementation specific features, such as gralloc flags,
are moved down into the V4L2Camera class out of the Camera class.

BUG: https://b/33057320, https://b/31044638
TEST: unit tests pass, some previously failing CTS tests are passing
(and no regressions), simple test camera preview app runs.

Change-Id: Ie8568239a1348dac45bf829ef928e500e01fdcda
2016-11-23 14:57:36 -08:00
Ari Hausman-Cohen
c5a4852451 Implement flushing and improve request tracking.
BUG: https://b/29937783, https://b/32941326
TEST: unit tests pass, fixes 8 failing cts tests
Change-Id: Idc390bdc1e51ba2bdbda91d90acc459a09a5f174
2016-11-21 17:17:29 -08:00
Ari Hausman-Cohen
71cb874e34 Add threading to camera.
Camera now has special synchronized threads to enqueue
buffers and dequeue buffers.

BUG: 29334616
TEST: manually tested with test app

Change-Id: Ibce14cd6b269c4d26403534b3f7985914263bf2b
2016-09-28 14:02:58 -07:00
Ari Hausman-Cohen
2738a9c3b5 Refactor capture processing to be async friendly
Set up a series of methods that can be producers/consumers/callbacks.
For now, they call each other synchronously.

TEST: manually tested with app
BUG: 29334616

Change-Id: Icb6cf9d9970521d5291c54f02dc5032f43b26616
2016-09-28 14:01:47 -07:00
Ari Hausman-Cohen
9430ad946f Clean up format of V4L2Camera and V4L2CameraHAL.
BUG: 30224839
TEST: unit tests pass
Change-Id: I0d41927fb6e56cf32f5e04a3fe98be1139e6c4a8
2016-08-30 18:19:31 -07:00
Ari Hausman-Cohen
abbf9cc0bd Plug in metadata refactor.
Replaces metadata usage in Camera/V4L2Camera with the
new Metadata class.

Switches Camera from camera_metadata_t to android::CameraMetadata
where appropriate for ease of use/clarity of ownership.

Also cleaned up some "error" logs that were potentially expected,
leaving it to the caller to log if something goes wrong, since
they were numerous and cluttering the log feed.

BUG: https://b/30140438, https://b/29335262
TEST: unit tests pass, test picture program still works,
  tested setting a V4L2 control to a non-default value.
Change-Id: I24e50c9b71736dfc576debf8d09dbe36b9bbf23a
2016-08-30 18:18:28 -07:00
Ari Hausman-Cohen
9e6fd98945 Add format querying.
Query formats, sizes, and frame rates.

BUG: https://b/29394024, https://b/30605346
TEST: Test java program shows a bunch of formats & rates,
can take pictures in different sizes now.

Change-Id: I203fd8f200dda79cf6946c58f130548b05269fbd
2016-08-08 16:29:21 -07:00
Ari Hausman-Cohen
ab3a0a4620 Add fixed properties to v4l2_metadata constructor.
BUG: 30140438
Change-Id: I371d00a19d89b439e72805a1bd9b23fc42ee8400
2016-08-04 18:40:44 -07:00
Ari Hausman-Cohen
3841a7f495 Style fix: renaming and include guards.
Fixes file name style and include guard style, before
even more and more files get added.

BUG: 30224839
Change-Id: Ie5ebcf14672c7e9d3faae86b88d4f62b516ae00d
TEST: test program that takes a picture still works.
2016-07-25 11:00:34 -07:00