libcamera/src/android
Umang Jain 64bcbd0e2c android: camera_device: Refactor descriptor status and sendCaptureResults()
Currently, we use Camera3RequestDescriptor::Status to determine:
- When the descriptor has been completely processed by HAL
- Whether any errors were encountered, during its processing

Both of these are essential to know whether the descriptor is eligible
to call process_capture_results() through sendCaptureResults().
When a status(Success/Error) is set on the descriptor, it is ready to
be sent back via sendCaptureResults(). However, this might lead to
undesired results especially when sendCaptureResults() runs in a
different thread (for e.g. stream's post-processor async completion
slot).

This patch decouples the descriptor status (Success/Error) from the
descriptor's completion status (pending or complete). The advantage
of this is we can set the completion status when the descriptor has
been processed fully by the layer and we can set the error status on
the descriptor wherever an error is encountered, throughout the
lifetime of the descriptor in the HAL layer.

While at it, introduce a wrapper completeDescriptor() around
sendCaptureResults(). completeDescriptor() as the name suggests will
mark the descriptor as complete, so it is ready to be sent back.
The locking mechanism is moved from sendCaptureResults() to this wrapper
since the intention is to use completeDescriptor() in place of existing
sendCaptureResults() calls.

Also make sure the sequence of abortRequest() call happens in the same
order at all places i.e. after its added to the descriptors_ queue. Fix
one of the abortRequest() call accordingly.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
2021-10-26 16:11:17 +05:30
..
cros android: cros: Simplify integration 2021-06-25 16:09:46 +01:00
data android: nautilus: Add camera HAL configuration 2021-08-04 09:03:37 +05:30
jpeg android: post_processor_jpeg: Replace encoder_ nullptr check 2021-10-26 16:11:17 +05:30
metadata android: metadata: Add SPDX tag 2019-08-12 10:34:13 +02:00
mm android: mm: cros_camera_buffer: Log failure error on cleanup 2021-09-09 11:44:30 +05:30
yuv android: camera_stream: Plumb process() with Camera3RequestDescriptor 2021-10-19 19:15:27 +05:30
camera3_hal.cpp libcamera/base: Move extended base functionality 2021-06-25 16:11:08 +01:00
camera_buffer.h android: camera_buffer: Add stride/offset/size function 2021-08-27 00:52:32 +03:00
camera_capabilities.cpp android: capabilities: Cap frame rate to 30 FPS 2021-10-15 09:32:32 +02:00
camera_capabilities.h android: capabilities: Collect absolute max frame durations 2021-10-15 09:32:31 +02:00
camera_device.cpp android: camera_device: Refactor descriptor status and sendCaptureResults() 2021-10-26 16:11:17 +05:30
camera_device.h android: camera_device: Refactor descriptor status and sendCaptureResults() 2021-10-26 16:11:17 +05:30
camera_hal_config.cpp libcamera: base: extensible: Pass private pointer as unique_ptr<> 2021-08-16 23:57:27 +03:00
camera_hal_config.h libcamera/base: Move class helpers to the base library 2021-06-25 16:11:03 +01:00
camera_hal_manager.cpp android: Override camera as "Internal" provided found in HAL config 2021-08-04 09:03:33 +05:30
camera_hal_manager.h android: Disable copy and move for CameraHalManager 2021-07-06 19:58:36 +03:00
camera_metadata.cpp android: camera_metadata: Rename get() to getMetadata() 2021-10-19 19:17:31 +05:30
camera_metadata.h android: camera_metadata: Rename get() to getMetadata() 2021-10-19 19:17:31 +05:30
camera_ops.cpp android: Implement flush() camera operation 2021-06-14 12:26:28 +02:00
camera_ops.h android: Remove internal thread 2020-02-13 13:23:23 +02:00
camera_request.cpp android: camera_device: Refactor descriptor status and sendCaptureResults() 2021-10-26 16:11:17 +05:30
camera_request.h android: camera_device: Refactor descriptor status and sendCaptureResults() 2021-10-26 16:11:17 +05:30
camera_stream.cpp android: camera_stream: Replace post-processor nullptr check 2021-10-26 16:11:17 +05:30
camera_stream.h android: camera_stream: Define explicit move constructor and destructors 2021-10-19 19:16:01 +05:30
camera_worker.cpp android: camera_worker: Use Camera3RequestDescriptor as cookie 2021-09-30 18:28:36 +05:30
camera_worker.h android: camera_worker: Use Camera3RequestDescriptor as cookie 2021-09-30 18:28:36 +05:30
meson.build camera_device: Remove private scope of Camera3RequestDescriptor 2021-10-19 19:14:53 +05:30
post_processor.h android: camera_stream: Plumb process() with Camera3RequestDescriptor 2021-10-19 19:15:27 +05:30