Commit graph

883 commits

Author SHA1 Message Date
Brian Duddie
7b007c989f Add bstack to sensors OWNERS file
Test: n/a
Change-Id: I25ae89abe1dfe1552e92cccf0354a269959c0c13
2018-11-30 13:33:20 -08:00
Ari Hausman-Cohen
8f89886dad Merge "camera: initialize smart pointer before usage" 2018-10-31 18:34:16 +00:00
Sergii Piatakov
16d9135088 camera: initialize smart pointer before usage
Test: try to scale image and get SIGSEGV crash of the `cameraserver`
      in the `CachedFrame` class.
Change-Id: I17ab13f7c9e7fc84cd38f89dce30e6e5e0535cc7
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-10-22 08:59:57 +03:00
Chih-Hung Hsieh
f91bd7232d Allow implicit-fallthrough warnings locally.
It will be a global error by default.

Test: make checkbuild
Bug: 112564944
Change-Id: Ifdcaca758036cf9624f79befb65a1cbbd2f9b010
Exempt-From-Owner-Approval: do not block on new warnings
2018-10-19 15:26:45 -07:00
Sergii Piatakov
028763d929 camera: avoid narrowing of the ioctl request
The `ioctl` take request of the `unsinged long` type but current
implementation narrows it up to `int`.

Test: if add something like this into `IoctlLocked`:
      ```
      switch (request) {
        case VIDIOC_QBUF: break;
        default:;
      }
      ```
      the following error is appears: "error: case value evaluates
      to 3227014671, which cannot be narrowed to type 'int'
      [-Wc++11-narrowing]".
Change-Id: Icb1c99e082feb0c019393205a4b0b717ddc09c05
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-10-10 17:49:02 +03:00
Sergii Piatakov
628e9d98e7 camera: replace -Wno-error flag with -Werror
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: Ib7227f189cdcd52698ef1a70b1ad03b2351cb55f
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-13 09:00:05 +03:00
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
21583568a8 camera: fix -Wpessimizing-move 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: I464761128a09d90415ee6ac1ef1244391edb0b54
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:39:32 +03:00
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
64e7f2013b camera: fix -Wsign-compare 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: I47ee9e39c3bfee7927f4e57dfec459714c959e14
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:39:23 +03:00
Sergii Piatakov
416b6d263f camera: fix -Wunused-variable 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: I2755278b739db0bb746a78d0b66e1f644a44ff19
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:37:02 +03:00
Sergii Piatakov
752836d7a6 camera: fix -Wunused-private-field 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: I113e14a4296e098a6a04068262186aa8cb81fba7
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:37:02 +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
4d3eb7a33f camera: fix -Wunused-parameter 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: I1bfd688902c78fe69bfbee3bacc73c25a5ef6c5c
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-08-10 14:37:02 +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
Ashutosh Joshi
b07ab6fd1d Merge "Update OWNERS" into pi-dev 2018-03-06 23:12:45 +00:00
Ashutosh Joshi
797ae998eb Update OWNERS
Update OWNERS to new stewards.

Test: Build compiles.
Change-Id: I98f9f58bce6b3686f3ff67f28f3e8d2f2ddf0a88
2018-03-06 03:46:20 +00:00
Mikhail Naganov
16ad46ef48 Revert recent r_submix patches
Revert "r_submix: Fix logspam on pipe corruption"
This reverts commit ab5b51838c.
Revert "r_submix: Use intermediate pipe in non-blocking mode"
This reverts commit 1df8a0039f.

Reason: breaks Android Auto projected mode

Bug: 74142786
Test: with Android Auto head unit simulator
Change-Id: I8e1bc146a131cb5b1ab88cf242b03a6b02a84339
2018-03-05 20:39:30 +00:00
Mikhail Naganov
ab5b51838c r_submix: Fix logspam on pipe corruption
Prevent logging an error message on every attempt to write
if the FIFO backing up the MonoPipe got corrupted. This condition
can be detected by checking for -EIO error code.

Bug: 74067530
Test: make audio_utils_fifo_base::mIsShutdown to be set by default,
      run r_submix_tests and observe logcat

Change-Id: I5d67997e902e834f04c10f9ffb39b16cba9c5739
2018-03-01 13:49:58 -08:00
Mikhail Naganov
1df8a0039f r_submix: Use intermediate pipe in non-blocking mode
Switch the pipe into non-blocking mode to prevent stalling
when attempting to close it.

Simulate circular buffer behavior by flushing old data if
there is no more space in the pipe.

This removes the need for "exiting=1" parameter.

Bug: 73175392
Test: r_submix_tests
Change-Id: Iff89980af71112892ff262030e471ae736b1f62a
2018-02-27 10:11:33 -08:00
Mikhail Naganov
bf115538e8 r_submix: Add more tests
From analyzing the coverage data, these tests seem to cover
all the critical functionality of the remote submix module.

Bug: 73175392
Test: r_submix_tests
Change-Id: I7f6be95245c6ab59611fc5e269e3f9f2079b8ee4
2018-02-27 10:02:33 -08:00
Mikhail Naganov
eff2bf016b Merge "r_submix: Add some tests" 2018-02-21 21:48:44 +00:00
Mikhail Naganov
80179932c9 r_submix: Add some tests
Add simple tests to verify remote submix behavior regarding
blocking writes. Currently one of the tests fails (does not finish),
this needs to be fixed.

Also fixed some minor issues in remote submix module code.

Bug: 73175392
Test: r_submix_tests
Change-Id: Ic88d0c385c0102e35b4f751f9c5cd8a6488949c8
2018-02-15 17:09:47 -08:00
George Burgess IV
4028ac9ae6 Fix a memory leak
If status < 0, we'd silently leak dev.

Bug: None
Test: Ran the analyzer; memory leak warnings are gone.
Change-Id: I76a78feea4c92aa167de908f5571481864d61d73
2018-02-13 00:33:26 +00:00
John Muir
001e6f4650 audio: Update default audio implementation.
Allow the default audio implementation to use the sample rate and
format provided by the application, but default to 16-bit stereo
for both input and output.

Also, default to 10ms output buffer and 20ms input buffer.

Bug: 70692394
Test: Audio device and output stream created successfully with
      the default frame_count.
      Audio device reports 20ms for input buffer size.
      Audio input stream created successfully with defaults.
      Setup device with audio_policy_configuration_stub.xml;
          no failures for GTS tests: GtsGmscoreHostTestCases
          -t 'com.google.android.gts.audio.AudioHostTest'
Change-Id: If496fc89f72f26266a7ed9b59acf88d1ca76e704
2018-01-30 12:05:24 -08:00
Hongwei Wang
82e4dc70f4 Removes vehicle.default target
Bug: 72179784
Test: None

Change-Id: Ia96ef01c98565deb8920d1df2eee31149a2a9338
2018-01-25 15:58:11 -08: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
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
TreeHugger Robot
f78d716b89 Merge "Support native camera resolutions" 2018-01-04 06:31:28 +00:00
Josh Gao
9eb0a7b073 Merge "Don't TEMP_FAILURE_RETRY on close." am: e1c003dc11 am: 7f4b73fb1a
am: 619653d7b1

Change-Id: I1f896a59da33be27a5d81362a6a1897f0ec277cf
2017-12-29 00:29:48 +00:00
Treehugger Robot
e1c003dc11 Merge "Don't TEMP_FAILURE_RETRY on close." 2017-12-29 00:19:21 +00:00
Josh Gao
09a3af5e11 Don't TEMP_FAILURE_RETRY on close.
close always succeeds, even if it was interrupted and "fails" with
EINTR. Retrying will either close a nonexistent fd or stomp on another
thread's newly opened file descriptor.

Bug: http://b/20501816
Test: treehugger
Change-Id: I706d5e8027e60b13f23f9488fdf5cf7cef7b3d3b
2017-12-28 14:21:32 -08:00
Dan Willemsen
844c74a750 Merge "Convert to Android.bp" am: 90e0a80af3 am: 243ba5e7b2
am: 90955e6a6a

Change-Id: I8e4e8c784b4e6630b7d062c4238d8c885111df30
2017-12-28 19:38:41 +00:00
Dan Willemsen
86e247ae89 Convert to Android.bp
See build/soong/README.md for more information

Test: mmma hardware/libhardware
Change-Id: Ibb7e2af9d55f581e951d8996cea5e52cd0766b04
2017-12-27 11:05:29 -08:00
Jaesung Chung
932d4dddd9 Support native camera resolutions
This CL makes camera HAL support native camera resoultions up to
3280x2464, which is the maximum camera resolution of RPi3's camera
module version two.

Bug: 69983703
Test: Verified with ThingsCameraQA.apk
Exempt-From-Owner-Approval: V4L2 camera HAL is owned by iot team.
Change-Id: I303e763e87bdfc5ae81d398aac8be0730e57b05d
2017-12-26 03:09:59 +00:00
Chih-hung Hsieh
fbb4c361fb Merge "Allow warnings in modules/camera/3_4." am: 1d83294190 am: 37724db429
am: 94202cf12e

Change-Id: I714a5fcd60d00f2811d15be614229fa25d50ef85
2017-12-20 02:06:55 +00:00
Chih-Hung Hsieh
87ef6ef33d Allow warnings in modules/camera/3_4.
* This directory still has many warnings to fix.

Bug: 66996870
Test: normal build
Change-Id: I0e05b78eca9d58dc9081bb3810f5ccabadfc21a7
Exempt-From-Owner-Approval: quick fix for broken build
2017-12-19 17:52:51 -08:00
Chih-Hung Hsieh
3a549d438b Merge "Fix compiler warnings." am: 2623d1370f am: 8f7122a989
am: 28d9d65ffb

Change-Id: I981642310f1a0b7b49315d437c47a8070747fe6d
2017-12-20 00:19:36 +00:00
Chih-Hung Hsieh
5c0702fb58 Fix compiler warnings.
* Remove unused local variables, functions, and private fields.

Bug: 66996870
Test: normal build
Change-Id: I3a5d6035a61be1b846dc8df3807088d2ca5dc4a3
2017-12-19 13:42:15 -08:00
Chih-Hung Hsieh
3d38c60317 Remove unused variables/labels to eliminate compile warnings.
Test: built and run on Marlin and testing with various USB peripherals.
Bug:70180519
Merged-Id: I68d7d33ffff8983117508e02a76d62c71d708c76
(cherry picked from commit 96c4d3035a)

Change-Id: If2a11bb5e649472d8bc25b5804715d6da48e5330
2017-12-15 14:33:56 -08:00
Dan Albert
332da11294 Include what you use.
Test: mma
Bug: None
Change-Id: I024a2ee0af142c1bb923fcefd54b8b2077107476
Exempt-From-Owner-Approval: trivial cleanup
2017-12-12 15:42:00 -08:00
Chih-hung Hsieh
a7348efe27 Merge "Allow warnings in modules/camera/3_4." am: d8bffba62a am: dd67309182
am: 38a4fbe55b

Change-Id: If914c66f7c5be51db275cc73f2deb6bb0d19f594
2017-12-08 04:51:30 +00:00
Chih-Hung Hsieh
37ee37170d Allow warnings in modules/camera/3_4.
* This directory still has many warnings to fix.

Bug: 66996870
Test: normal build
Exempt-From-Owner-Approval: quick fix for broken build
Change-Id: I7f3cef3016ba16cb7ddbe6721cf74c71c1cbf1a2
2017-12-07 03:14:09 +00:00
Chih-Hung Hsieh
26ab80dcaa Merge "Use -Werror in hardware/libhardware/modules" am: 298fc4f6f5 am: 66f312b91c
am: 81a536751c

Change-Id: I78eb43d3b34086a03d3e24c7b2ce4b5b2ea1d393
2017-12-06 18:54:17 +00:00
Chih-Hung Hsieh
66f312b91c Merge "Use -Werror in hardware/libhardware/modules"
am: 298fc4f6f5

Change-Id: I3c23dc4ce4609ec27402cae52b71ef79067c8e73
2017-12-06 18:42:24 +00:00
TreeHugger Robot
95953ab214 Merge "Remove unused variables/labels to eliminate compile warnings." 2017-12-05 20:49:44 +00:00
Paul McLean
96c4d3035a Remove unused variables/labels to eliminate compile warnings.
Test: built and run on Marlin and testing with various USB peripherals.
Bug:70180519
Change-Id: I68d7d33ffff8983117508e02a76d62c71d708c76
2017-12-05 09:50:26 -08:00
Chih-Hung Hsieh
1f601b1d7d Use -Werror in hardware/libhardware/modules
* Remove unused local variables.
* Remove or comment out unused static functions.
* Fix trivial bugs found by unused value warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I99389b883c89551850180d25241a35a40bb77b26
2017-12-01 10:37:19 -08:00
Paul McLean
9880f12e19 Removing unused and misleading constant.
Test: None needed.

Change-Id: I1fa020f38f488b0cf5196284f29220c3e6c1acd0
2017-11-30 12:15:44 -07:00