summaryrefslogtreecommitdiff
path: root/modules/camera
Commit message (Collapse)AuthorAgeFilesLines
* Remove libBionicGtestMainChangyeon Jo2019-06-041-1/+0
| | | | | | | | | This change removes libBionicGtestMain from the dependency of camera.v4l2_test target. Bug: 134488555 Change-Id: Ia719f770b03fa1679bb9467f58806e64b05eb469 Signed-off-by: Changyeon Jo <changyeon@google.com>
* Fixes incorrect array initialization.Changyeon Jo2019-02-261-1/+1
| | | | | | | | | This change fixes an array initialization failure due to recent resizing of camera_module structure's reserved variable. Bug: 126418509 Change-Id: Ifda61b5427f317192976aee788d0e6849f7d189f Signed-off-by: Changyeon Jo <changyeon@google.com>
* Merge "camera: add info about current status into README" am: 3d7f02b0ee am: ↵Sergii Piatakov2019-01-281-0/+8
|\ | | | | | | | | | | | | | | 11f257623b am: af36e97a4b Change-Id: I95f2896055e353060c1a3395520aeb719e986832
| * Merge "camera: add info about current status into README"Treehugger Robot2019-01-281-0/+8
| |\
| | * camera: add info about current status into READMESergii Piatakov2018-10-171-0/+8
| | | | | | | | | | | | | | | | | | Test: n/a. Change-Id: I9e62a8a6d8c04dac2c36bc483f011cb75ce20b2e Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
* | | Merge "Revert "Disable XOM in camera.v4l2."" am: 06ea58579b am: 36de427e99Ivan Lozano2019-01-151-7/+0
|\| | | | | | | | | | | | | | | | | am: ac77fa8c78 Change-Id: Ia803f91a5487bb0d42ecc73163c34c151795d1c3
| * | Merge "Revert "Disable XOM in camera.v4l2.""Treehugger Robot2019-01-161-7/+0
| |\ \
| | * | Revert "Disable XOM in camera.v4l2."Ivan Lozano2019-01-151-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7c7c62db251ba3deade6ba8bb1536b7ef0001d24. Reason for revert: libjpeg-turbo has been updated with XOM compatibility. Change-Id: If1daae895f9cfe08c03169ed2546c81c51a94117
* | | | Merge "camera: add a lock for the request tracker" am: 8c3812f639 am: 421cd310cfAri Hausman-Cohen2019-01-102-8/+11
|\| | | | | | | | | | | | | | | | | | | | | | | am: 7bac9b0e96 Change-Id: Ie4877dd1169e99fe8e2dcfa64cc9a77de44492ae
| * | | Merge "camera: add a lock for the request tracker"Ari Hausman-Cohen2019-01-102-8/+11
| |\ \ \
| | * | | camera: add a lock for the request trackerSergii Piatakov2018-10-172-8/+11
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The request tracker manages "in flights" buffers and frames. These two containers are modified by calling the tracker's member functions. Such functions are called from at least three threads: (see `v4l2_camera.cpp` for more details): - "main" thread; - separate buffer enqueue thread ("Enqueue buffers"); - separate buffer dequeue thread ("Dequeue buffers"). It is proposed to introduce additional mutex for the request tracker to prevent a race condition. An alternative approach is introducing an additional mutex for the shared containers inside the `RequresTracker` class. But such approach requires more changes and may lead to problems with design in the future. This commit contains a few additional changes which are not directly related to the topic: - as far as more than one local lock is used all of them are renamed; - the `mFlushLock` member is removed because it is completely covered by the new mutex. Test: try to use a camera with more than one buffer and get SIGSEGV crash of the `cameraserver` in the `RequestTracker` class. Change-Id: I2c1901722289cee9f0cb05a11a4dabe70d18f2ba Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
* | | | Merge "camera: remove redundant and unnecessary includes" am: 9dae907ea0 am: ↵Sergii Piatakov2019-01-0963-144/+69
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 547abc4ae4 am: eb83d293ff Change-Id: I38c53a926e1cabd67c194714ca52e4f5f0b417e3
| * | | Merge "camera: remove redundant and unnecessary includes"Treehugger Robot2019-01-1063-144/+69
| |\ \ \
| | * | | camera: remove redundant and unnecessary includesSergii Piatakov2018-10-1863-144/+69
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused or already included headers. Sort and format includes accordind to the "Google C++ Style Guide". Replace C-headers by C++ analog when it's possible. Test: build Change-Id: I19fa6abb5bb68e0257c9c933e68f42f92b394ce7 Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
* | | | Merge "camera: allow to get size of JPEG after conversion" am: 3664a25aa7 ↵Sergii Piatakov2019-01-081-0/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 18033cb5d5 am: ddcd9c949f Change-Id: I00e6cba64605a7669b7fc127bb70cc2b83dda4bc
| * | | Merge "camera: allow to get size of JPEG after conversion"Treehugger Robot2019-01-091-0/+5
| |\ \ \ | | |_|/ | |/| |
| | * | camera: allow to get size of JPEG after conversionSergii Piatakov2018-10-221-0/+5
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The member function `ImageProcessor::GetConvertedSize` is called by the `ImageProcessor::ConvertFormat` every time when conversion is performed. But for JPEG destination format it leads to error. It is proposed to add the handling of the JPEG format with postponed size calculation. Test: try to take a picture via camera with YUYV output format. Change-Id: I1ec564e2434361c82b5d93348511116494249f06 Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
* | | Merge "Disable XOM in camera.v4l2." am: 1908ba0732 am: 6ca60bc346Ivan Lozano2018-12-131-0/+7
|\| | | | | | | | | | | | | | | | | am: c334599dfe Change-Id: I730f62bfb2f28cf919614af3a5f7e0b8445079b0
| * | Disable XOM in camera.v4l2.Ivan Lozano2018-11-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable execute-only memory layouts in camera.v4l2. This relies on libjpeg_static_ndk, which contains some data mixed into code and thus requires a readable .text. Bug: 77958880 Test: Built the library, checked the program headers with readelf. Change-Id: I5646b8c5e9a0ad151663df29f019b5a84db4b15c
* | | Merge "camera: initialize smart pointer before usage" am: 8f89886dad am: ↵Ari Hausman-Cohen2018-10-311-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | b893b0cedb am: c8083cac38 Change-Id: I11bdbcdb80fa772d17c9088f43c01581d00e7851
| * | camera: initialize smart pointer before usageSergii Piatakov2018-10-221-1/+2
| |/ | | | | | | | | | | | | 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>
* | Merge "camera: avoid narrowing of the ioctl request" am: eef57caed9 am: ↵Ari Hausman-Cohen2018-10-112-2/+2
|\| | | | | | | | | | | | | | | 3d22b204f2 am: 00d9bf50ec Change-Id: Idfca5de8347a38c3ab2cf0da002e3a2e4657d5e2
| * camera: avoid narrowing of the ioctl requestSergii Piatakov2018-10-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix v4l2 camera HAL to compile with version 2.5Steve Fung2018-09-181-1/+2
|/ | | | | | | | | The camera module API version 2.5 added a new function, dropping the number of reserved to 4. Bug: None Test: Builds Change-Id: Ib3df07481ba54509a1215e642ccf70d0b1d4dd2c
* camera: replace `-Wno-error` flag with `-Werror`Sergii Piatakov2018-08-131-1/+1
| | | | | | | | 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>
* camera: fix `-Wunused-function` compiler warningsSergii Piatakov2018-08-102-18/+15
| | | | | | | | 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>
* camera: fix `-Wpessimizing-move` compiler warningsSergii Piatakov2018-08-101-1/+1
| | | | | | | | 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>
* camera: fix `-Wmissing-field-initializers` compiler warningsSergii Piatakov2018-08-103-11/+25
| | | | | | | | 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>
* camera: fix `-Wsign-compare` compiler warningsSergii Piatakov2018-08-102-10/+10
| | | | | | | | 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>
* camera: fix `-Wunused-variable` compiler warningsSergii Piatakov2018-08-101-1/+0
| | | | | | | | 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>
* camera: fix `-Wunused-private-field` compiler warningsSergii Piatakov2018-08-102-7/+3
| | | | | | | | 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>
* camera: fix `-Wreorder` compiler warningsSergii Piatakov2018-08-101-3/+3
| | | | | | | | 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>
* camera: fix `-Wunused-parameter` compiler warningsSergii Piatakov2018-08-104-16/+16
| | | | | | | | 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>
* camera: fix `-Wformat` compiler warningsSergii Piatakov2018-08-106-15/+15
| | | | | | | | 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>
* camera: fix `-Wmacro-redefined` compiler warningsSergii Piatakov2018-08-1021-25/+49
| | | | | | | | 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>
* camera 3_4: Fix compilation errorsDmitry Shmidt2018-01-243-4/+4
| | | | | | | | | | | | | | | 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>
* v4l2 camera: port ARC++ image processing codePrashanth Swaminathan2018-01-1032-715/+2796
| | | | | | | | | | | | | | | 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
* Merge "Support native camera resolutions"TreeHugger Robot2018-01-042-3/+15
|\
| * Support native camera resolutionsJaesung Chung2017-12-262-3/+15
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Don't TEMP_FAILURE_RETRY on close." am: e1c003dc11 am: 7f4b73fb1aJosh Gao2017-12-291-1/+1
|\ \ | | | | | | | | | | | | | | | am: 619653d7b1 Change-Id: I1f896a59da33be27a5d81362a6a1897f0ec277cf
| * \ Merge "Don't TEMP_FAILURE_RETRY on close."Treehugger Robot2017-12-291-1/+1
| |\ \
| | * | Don't TEMP_FAILURE_RETRY on close.Josh Gao2017-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Convert to Android.bp" am: 90e0a80af3 am: 243ba5e7b2Dan Willemsen2017-12-282-45/+47
|\| | | | |_|/ |/| | | | | | | | | | | am: 90955e6a6a Change-Id: I8e4e8c784b4e6630b7d062c4238d8c885111df30
| * | Convert to Android.bpDan Willemsen2017-12-272-45/+47
| | | | | | | | | | | | | | | | | | | | | See build/soong/README.md for more information Test: mmma hardware/libhardware Change-Id: Ibb7e2af9d55f581e951d8996cea5e52cd0766b04
* | | Merge "Allow warnings in modules/camera/3_4." am: 1d83294190 am: 37724db429Chih-hung Hsieh2017-12-201-1/+1
|\| | | | | | | | | | | | | | | | | am: 94202cf12e Change-Id: I714a5fcd60d00f2811d15be614229fa25d50ef85
| * | Allow warnings in modules/camera/3_4.Chih-Hung Hsieh2017-12-191-1/+1
| |/ | | | | | | | | | | | | | | | | * 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
| * Include what you use.Dan Albert2017-12-121-0/+2
| | | | | | | | | | | | | | Test: mma Bug: None Change-Id: I024a2ee0af142c1bb923fcefd54b8b2077107476 Exempt-From-Owner-Approval: trivial cleanup
* | Merge "Allow warnings in modules/camera/3_4." am: d8bffba62a am: dd67309182Chih-hung Hsieh2017-12-081-1/+1
|\| | | | | | | | | | | am: 38a4fbe55b Change-Id: If914c66f7c5be51db275cc73f2deb6bb0d19f594
| * Allow warnings in modules/camera/3_4.Chih-Hung Hsieh2017-12-071-1/+1
| | | | | | | | | | | | | | | | | | * 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
* | Merge "Use -Werror in hardware/libhardware/modules" am: 298fc4f6f5 am: ↵Chih-Hung Hsieh2017-12-062-2/+2
|\| | | | | | | | | | | | | | | 66f312b91c am: 81a536751c Change-Id: I78eb43d3b34086a03d3e24c7b2ce4b5b2ea1d393