summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-05-10 10:13:36 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-06-14 12:26:28 +0200
commitefd5fb7288a7a9c72f3ae7b1256c2b808aaf525f (patch)
tree7e034a7a29c2be7b4c6ca423fbd67a3349226bc9 /src/android/camera_device.h
parent103dfb85a7e12c00c1a41eef69f45faa8f5c7597 (diff)
android: Implement flush() camera operation
Implement the flush() camera operation in the CameraDevice class and make it available to the camera framework by implementing the operation wrapper in camera_ops.cpp. Introduce a new camera state State::Flushing to handle concurrent flush() and process_capture_request() calls. As flush() can race with processCaptureRequest() protect it by introducing a new State::Flushing state that processCaptureRequest() inspects before queuing the Request to the Camera. If flush() is in progress while processCaptureRequest() is called, return the current Request immediately in error state. If flush() has completed and a new call to processCaptureRequest() is made just after, start the camera again before queuing the request. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> 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, 3 insertions, 0 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index c949fa50..4aadb27c 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -43,6 +43,7 @@ public:
int open(const hw_module_t *hardwareModule);
void close();
+ void flush();
unsigned int id() const { return id_; }
camera3_device_t *camera3Device() { return &camera3Device_; }
@@ -92,6 +93,7 @@ private:
enum class State {
Stopped,
+ Flushing,
Running,
};
@@ -106,6 +108,7 @@ private:
getRawResolutions(const libcamera::PixelFormat &pixelFormat);
libcamera::FrameBuffer *createFrameBuffer(const buffer_handle_t camera3buffer);
+ void abortRequest(camera3_capture_request_t *request);
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
void notifyError(uint32_t frameNumber, camera3_stream_t *stream,
camera3_error_msg_code code);