This reverts commit 7c7c62db25.
Reason for revert: libjpeg-turbo has been updated with XOM compatibility.
Change-Id: If1daae895f9cfe08c03169ed2546c81c51a94117
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
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>
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>
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>
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>
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>
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
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
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
* 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
* 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
* 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
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
BGR32 mode is in RPi3's camera has a RB color swapping issue. This CL
makes to use stable RGB24 mode instead to avoid the problem without
causing any quality regression.
Bug: 69075512
Test: RB color swapping problem is gone on preview, recording and stil.
Exempt-From-Owner-Approval: HAL is owned by Things team.
Change-Id: I109363c0f68cec45f92e739a978f554e70032151
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)
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