summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-05-04 16:02:33 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-06-14 12:26:27 +0200
commita86d281e52c772c4d40c6b9578c1eec8de8c5ca2 (patch)
tree7b6952592c362706bf113b720c65aa777aa264ab /src/android/camera_device.h
parent15196e5b76f184d3d27900749de0bf7010226261 (diff)
android: Rework request completion notification
The current implementation of CameraDevice::requestComplete() which handles event notification and calls the framework capture result callback does not handle error notification precisely enough. In detail: - Error notification is an asynchronous callback that has to be notified to the framework as soon as an error condition is detected, and it independent from the process_capture_result() callback - Error notification requires the HAL to report the precise error cause, by specifying the correct CAMERA3_MSG_ERROR_* error code. The current implementation only notifies errors of type CAMERA3_MSG_ERROR_REQUEST at the end of the procedure, before the callback invocation. Rework the procedure to: - Notify CAMERA3_MSG_ERROR_DEVICE and perform library tear-down in case a Fatal error is detected - Notify CAMERA3_MSG_ERROR_REQUEST if the libcamera::Request::status is different than RequestCompleted and immediately call process_capture_result() with all buffers in error state. - Notify the shutter event as soon as possible - Notify CAMERA3_MSG_ERROR_RESULT in case the metadata cannot be generated correctly and call process_capture_result() with the right buffer state regardless of metadata availability. - Notify CAMERA3_MSG_ERROR_BUFFER for buffers whose post-processing failed While at it, return the CameraStream buffer by calling cameraStream->putBuffer() regardless of the post-processing result. No regression detected when running CTS in LIMITED mode. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r--src/android/camera_device.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index 8190d929..decf1754 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -101,7 +101,8 @@ private:
libcamera::FrameBuffer *createFrameBuffer(const buffer_handle_t camera3buffer);
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
- void notifyError(uint32_t frameNumber, camera3_stream_t *stream);
+ void notifyError(uint32_t frameNumber, camera3_stream_t *stream,
+ camera3_error_msg_code code);
std::unique_ptr<CameraMetadata> requestTemplatePreview();
std::unique_ptr<CameraMetadata> requestTemplateVideo();
libcamera::PixelFormat toPixelFormat(int format) const;