android: camera_device: Build capture_result dynamically

The camera3_capture_result_t is only needed to convey capture results to
the camera service through the process_capture_result() callback.
There's no need to store it in the Camera3RequestDescriptor. Build it
dynamically in CameraDevice::sendCaptureResults() instead.

This requires storing the result metadata created in
CameraDevice::requestComplete() in the Camera3RequestDescriptor. A side
effect of this change is that the request metadata lifetime will match
the Camera3RequestDescriptor instead of being destroyed at the end of
requestComplete(). This will be needed to support asynchronous
post-processing, where the request completion will be signaled to the
camera service asynchronously from requestComplete().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart 2021-10-19 17:17:53 +05:30 committed by Umang Jain
parent 030c8f1a7e
commit 1abdcf803d
2 changed files with 27 additions and 25 deletions

View file

@ -40,8 +40,8 @@ public:
std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;
CameraMetadata settings_;
std::unique_ptr<CaptureRequest> request_;
std::unique_ptr<CameraMetadata> resultMetadata_;
camera3_capture_result_t captureResult_ = {};
Status status_ = Status::Pending;
private: