Unfortunately, our camera blobs are too old to implement camera HAL 3.2
properly. These hacks fix most camera functionality with HAL 3.2, but
they're not exactly clean...
Some pieces are based on the hammerhead HAL.
This isn't passing CTS, but it's not too far away.
Sadly, in the foreseeable future, I won't have time to clean it up...
Change-Id: Iff4f0f25fe767e498db6e56fc2f47a13c4a97364
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Map FACE_PRIORITY mode as Auto Scene Mode, so that
we don't have undefined behavior.
Bug: 11045793
Change-Id: Iaa7a30eef902c2ca0a700c498f88b7c77aa441fa
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
The start method of some streams
(most notably the metadata) could be
called twice. This scenario should be
handled by returning immediatly and
avoiding the initialization of new
threads and resources.
This change is authored by Emilian Peev
<epeevs@codeaurora.org>
Bug: 18258028
Bug: 17912331
Change-Id: Ife6613bdca069bc63193802e0bb88273e63998f9
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
We can have two output buffers per request
for cases like ZSL. When doing flush the
process capture result has to be called
only once for each frame number and should
contain all cancelled output buffers. Doing
this on a buffer basis will result in
unexpected frame number errors in the upper
framework.
The buffers should be again grouped depending
on their frame number and returned back in
single 'process_capture_result()' call.
Bug: 17113762
Change-Id: I422e86debb2d8e5e8bca1d402479e42f02d915a4
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
memset camera3_capture_result_t data structure before
using it in HAL.
Bug: 16132385
Change-Id: I0a55cf47984c1d1413b9a492d79543c47ff5bc23
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
0 is a valid file descriptor. Fix the code for checking
valid file descriptor.
This is a precautionary change.
Bug: 17113762
Change-Id: I65b206254eb63d888049b6daf650204b13afa444
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Remove unneeded heap allocations that could
lead to future leaks.
Bug: 13301331
Change-Id: Ib7671b88ddbe36575beaa8418c147ffaba3ef9de
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Instead of registering all buffers upfront
all client buffers are registered on-the-fly
during process capture requests.
Bug: 13301331
Change-Id: I6230829f9ac8eb1c7ddc26f2408dc948ce7b4682
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Our old camera blobs don't report this correctly, so let's hardcode.
Change-Id: I38b814a3f99a0793cb8084a53844d587cedb0378
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
The 'streamCbRoutine()' method of the reprocess
channel receive a camera super frame that was
previously allocated on heap and must release it
after exit
Bug: 13301331
Change-Id: Ie90f6b4f945f4b7fcc6c46d541871e44c3f6943b
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
This aligns with most max resolution picture size
aspect ratio. Also make the supported thumbnail
sizes to be in increasing order per spec.
Bug: 12101500
Change-Id: I5ed791f08225605b3a538039a05576da458b9109
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
When a shared library is loaded, the order in which its global
variables is not defined. For example, for case like below:
A a;
int *ptr = NULL;
Class A {
A() {
if (ptr == NULL) {
//do this;
} else {
// do that;
}
}
};
ptr could be initialized before or after A, which causes the
behavior of A's constructor to be different.
The fix is to use Plain Old Data (integer, float, char, or pointer)
as global variable, and defer instantiation of class instance to
runtime.
Bug: 11822202
Change-Id: I806c527f06e19fc44e880d9a536ee7a060b4fa4f
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
When flush is called, HAL drops all inflight requests
and buffers as soon as possible.
HAL implements this feature by:
1. Streams off all active streams,
2. Calls process_capture_result with ERROR_BUFFER for
pending requests for which metadata is generated, but
not all buffers are filled, and
3. Calls process_capture_result with ERROR_RESULT for
pending requests for which metadata is not generated
yet.
This change also fixes a bug in mm-camera-interface so
that queued_buffer_count is reset during reg_buf.
Bug: 9758581
Change-Id: Ibcb5dc52faf8d50f781ef514e4c79185311dafce
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Previously we were only checking max buffer dequeued when
metadata callback happens. HAL needs to do the same check
in buffer callback.
This change also breaks down the captureResultCb() function
which is long overdue.
This should help improve latency and performance because
we are unblocking capture_request early.
Bug: 11011342
Change-Id: I37a37e78a3534f780b4a92e46ab21f5ae78b5329
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
- As per documentation 'camera3_stream_t' objects
are owned by the framework and will be freed
before camera close. These objects are not to be
used when the Hal destructor is invoked.
BUG: 10689446
Change-Id: I1409319e7340846ca574b3987132a0ca3bbae8e9
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Name the stream process thread in HAL
Bug: 10609699
Change-Id: Ib272cd237fea8ad9e27994352e7acc7a1f56551c
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
- The array for holding registerd buffer handles
is not released during camera close. Also the
metadata frame allocated in 'QCamera3Stream'
needs to be freed after returning to camera.
Change-Id: Idb9e278583382e08df9c64d20d7f1c2af2488071
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
-In case of rapid back to back snapshots framework
reuses ZSL YUV frame
-Remove code in HAL which assumes that once a buffer
is passed as input it will not be used again
Change-Id: I72a0f527de99b96508c7020455a47bfe754d9df4
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
For video stream buffers, set READ_RARELY and WRITE_RARELY usage
flags so that gralloc may make them uncached.
Code cleanup
Bug: 10328870
Change-Id: If3bbbbb0976266f69962db7df568c763dad488aa
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Ensure that metadata is handled correctly for different
ZSL usecases.
Change-Id: Ic521f54b973535384cbc2ec94facea3a3f326648
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Add the reprocess path for ZSL to enable WNR, ASF and rotation
reprocess
Change-Id: I132be710e5fe1cc1436626679a7f533f73f9ae0a
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
The stream command thread will be released as
part of the stream stop but the channel poll
thread can still run until the channel is released.
In this case the synchronous poll delete during
stream stop can fail if the asynchronous poll version
got triggered immediately before that. The stop
will proceed and release the stream command thread
resources before the async poll update could be
processed. The poll thread could then try and
access the command thread resources resulting in
a crash. The failing sync poll delete should be
handled by syncing to the poll thread again and
allowing any previously pending async updates to
be processed before releasing any resources.
Bug: 14028116
CRs-Fixed: 629996
Change-Id: Ib6252445731d05c01a59503b3cfe70ef089a4ffd
This takes care of cases where mm-qcamera-daemon takes a long
time to launch. get_camera_info depends on mm-qcamera-daemon
being up and running to work.
In the worse case, get_camera_info will be held up by HAL for
200ms.
Bug: 10577806
Change-Id: I7068b0f60bf75c407b603f4e0a0bbb19b8f51f0c
If image is already rotated by post proc, swap the thumbnail
destination buffer width and height before giving it to the
encoder
Change-Id: I328a762887b469fc88d298c131cde356dc2dd03f
(cherry picked from commit ab93af6714041141d8a66e6e2c921097e1341a08)
In order to make generic system image, these QCOM-specific libs are
moved to vendor.img
Bug: 36043196
Test: make. flash. and chck that these are under /vendor/lib.
Change-Id: I53d84f1191b7562323b8405bc4a1ba35794375c0
After removing the prebuilt kernel headers, we need to include
the kernel headers from source to fix the build.
Change-Id: I0e7074076db50032862ae4d8f001580405e9cd99