Commit Graph

16 Commits

Author SHA1 Message Date
Sergii Piatakov
6a4d4d59bc camera: fix -Wmissing-field-initializers 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: I2c17b1e40b29ac400e0a950a9cd96d7f9404ea32
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:39:32 +03:00
Sergii Piatakov
a01d1f8233 camera: fix -Wformat 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: Ib1d1fc2de98436dd7e9d15ab324789725bb2002e
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:36:42 +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
Dmitry Shmidt
9df082e933 camera 3_4: Fix compilation errors
Compile Error:
hardware/libhardware/modules/camera/3_4/camera.cpp:502:9: error: non-constant-expression cannot be narrowed from type 'std::__1::vector<camera3_stream_buffer, std::__1::allocator<camera3_stream_buffer> >::size_type' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
        request->output_buffers.size(),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Test: Add to device.mk
        USE_CAMERA_V4L2_HAL := true
        PRODUCT_PACKAGES += camera.v4l2
      mma

Change-Id: Ia6bbd6bac06540214d2c6167a8826f3f4c946e57
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2018-01-24 12:34:00 -08:00
Eric Jeong
eadafff6ae Close acquire fence fd after camera capture
Camera capture should close acquire fence. If not, fd remains unused,
which consumes all available fd resources for a process (usually 1024).

Bug: 64214375
Test: Running camera preview of camera sample app for a long time
      should not break preview image.
Exempt-From-Owner-Approval: This is a cherry-pick CL from oc-iot-dev.      
Change-Id: I91d6d3a7b7a95ed5b33c7c73bc85d42f69f4c856
(cherry picked from commit da3c52413a7499a3cd91246b0634f839315ed7b7)
2017-11-13 06:52:28 +00:00
Ari Hausman-Cohen
5acb400d18 Fix camera close sequencing.
Flush the device before disconnecting from it.
Hasn't caused identifiable bugs yet, but seems
dangerous and easy to fix.

TEST: builds & runs sample

Change-Id: Icaf27d4de5628087278b84bff586aab8e1e62e28
2016-11-29 18:41:56 -08: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
e31e1f33b4 Only provide templates for supported capabilities
Plugs in the StaticProperties class for ease of accessing the
static metadata.

Expands StaticProperties to handle checking template support.

Test: Unit tests pass, test app runs, fixes 2 failing CTS tests on rpi3
BUG: b/32951283
Change-Id: I3077a3507751c3072b88f7d91902bdaa5b53c30e
2016-11-21 17:17:33 -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
ad6fe2b033 Remove spurious logging.
When logging was enabled, the log was a little *too*
verbose, making it unreadable. Removing some of the
more frequently hit log messages.

BUG: b/32942120
TEST: Can run camera samples
Change-Id: I136c20279699e4c87b3ef1c3042b88c20c301002
2016-11-18 11:27:30 -08:00
Ari Hausman-Cohen
0b2113c54f Track in-flight requests
This allows for verification of callbacks, and will also be helpful
when implementing flush.

BUG: 31653306
TEST: unit tests pass, test program runs
Change-Id: Id43d6cb3c2b9ca4adc96fc08282f88e0b7b904e1
2016-11-11 15:04:57 -08:00
Ari Hausman-Cohen
fb161115c8 Send error notification when request fails.
Sends a generic request error when a request fails.

BUG: 31653322
TEST: Test program runs
Change-Id: Ib0694d655e584dcfeaeacc1ce55177191abe42e3
2016-10-03 14:00:32 -07:00
Ari Hausman-Cohen
fbac174a46 Use correct gralloc flags in V4L2 Camera HAL
Also checks gralloc return results, and cleans up style.

BUG: https://b/31595935, https://b/31589070
TEST: test streaming app works
Change-Id: I4d910524ae21a7b666a1f456e2b7122a8671560f
2016-09-30 11:43:14 -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
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
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