[libcamera-devel] [RFC PATCH 2/2] android: camera_request: Lifetime of a Camera3RequestDescriptor
Umang Jain
umang.jain at ideasonboard.com
Wed Nov 10 08:30:49 CET 2021
This commit provides a sketch regarding Camera3RequestDescriptor
which is aids tracking each capture reuquest placed by the android
framework to libcamera HAL.
Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
src/android/camera_request.cpp | 97 ++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/src/android/camera_request.cpp b/src/android/camera_request.cpp
index 4e017792..824b667d 100644
--- a/src/android/camera_request.cpp
+++ b/src/android/camera_request.cpp
@@ -18,6 +18,9 @@ using namespace libcamera;
*
* A utility class that groups information about a capture request to be later
* reused at request complete time to notify the framework.
+ *
+ * Also, refer to the Camera3RequestDescriptor's lifetime diagram at the end of
+ * this file.
*/
Camera3RequestDescriptor::Camera3RequestDescriptor(
@@ -105,3 +108,97 @@ Camera3RequestDescriptor::StreamBuffer::StreamBuffer(StreamBuffer &&) = default;
Camera3RequestDescriptor::StreamBuffer &
Camera3RequestDescriptor::StreamBuffer::operator=(Camera3RequestDescriptor::StreamBuffer &&) = default;
+
+/*******************************************************************************
+ * Lifetime of a Camera3RequestDescriptor tracking a capture request placed by
+ * Android Framework
+ *******************************************************************************
+ *
+ *
+ * Android Framework
+ * â
+ * â ââââââââââââââââââââââââââââââââââââ
+ * â âcamera3_capture_request_t â
+ * â â â
+ * â âRequested output streams â
+ * â â stream1 stream2 stream3 ... â
+ * â ââââââââââââââââââââââââââââââââââââ
+ * â¼
+ * âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
+ * â libcamera HAL â
+ * âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
+ * â CameraDevice â
+ * â â
+ * â processCaptureRequest(camera3_capture_request_t request) â
+ * â â
+ * â - Create Camera3RequestDescriptor tracking this request â
+ * â - Streams requiring post-processing is stored as a â
+ * â map Camera3Requestdescriptor::pendingStreamsToProcess â
+ * â - Add this Camera3RequestDescriptor to descriptors' queue â
+ * â CameraDevice::descriptors_ â
+ * â â âââââââââââââââââââââââââââ
+ * â - Queue the capture request to libcamera core âââââââââââââ¤âºâlibcamera core â
+ * â â âââââââââââââââââââââââââââ¤
+ * â â â- Capture from Camera â
+ * â â â â
+ * â â â- Emit â
+ * â â â Camera::requestCompleteâ
+ * â requestCompleted(Request *request) âââââââââââââââââââââââââ¼ââ¼ââââ â
+ * â â â â
+ * â - Check request completion status â âââââââââââââââââââââââââââ
+ * â â
+ * â - If(pendingStreamsToProcess > 0) â
+ * â Queue all entries from pendingStreamsToProcess â
+ * â else â â
+ * â completeDescriptor() â ââââââââââââââââââââââââ
+ * â â â
+ * â ââââââââââââââââââââââââââââ´ââââ¬âââââââââââââââââââ â
+ * â â â â â
+ * â ââââââââââââ¼âââââââââââââ âââââââââââââ¼ââââââââââ â¼ â
+ * â âCameraStream1 â âCameraStream2 â .... â
+ * â ââ¬ââââ¬ââââ¬ââââââââââââââ⤠ââ¬ââââ¬ââââ¬ââââââââââââ⤠â
+ * â ââ â â â ââ â â â â
+ * â ââ¼ââââ¼ââââ¼ââââââââââââââ⤠ââ¼ââââ¼ââââ¼ââââââââââââ⤠â
+ * â âPostProcessorWorker ââ âPostProcessorWorker â â
+ * â â â â â â
+ * â â xxxxxxxxxxxxxxxxxxx â â xxxxxxxxxxxxxxxxxxx â â
+ * â â x PostProcessor x â â x PostProcessor x â â
+ * â â x process() x â â x process() x â â
+ * â â x x â â x x â â
+ * â â x Emit x â â x Emit x â â
+ * â â x processComplete x â â x processComplete x â â
+ * â â x x â â x x â â
+ * â â xxxxxxxxxxxxxxxâxxx â â xxxxxxxxxxxxxxxâxxx â â
+ * â â â â â â â â
+ * â â â â â â â â
+ * â ââââââââââââââââââ¼âââââââ ââââââââââââââââââ¼âââââ â
+ * â â â â
+ * â â â â
+ * â â â â
+ * â â¼ â¼ â
+ * â xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx â
+ * â x CameraDevice x x CameraDevice x â
+ * â x x x x â
+ * â x streamProcessingComplete() x x streamProcessingComplete() x â
+ * â x x x x â
+ * â x - Check and set buffer status x x - Check and set buffer status x â
+ * â x - Remove post-processing entry x x - Remove post-processing entry x â
+ * â x from pendingStreamsToProcess x x from pendingStreamsToProcess x â
+ * â x x x x â
+ * â x - If(pendingStreamsToProcess.empty()x x - If(pendingStreamsToProcess.empty()x â
+ * â x completeDescriptor x x completeDescriptor x â
+ * â x x x x â
+ * â xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx â
+ * â â
+ * ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
+ *
+ *
+ *
+ *
+ *
+ *
+ * xxxxxxxxxxxxxx
+ * x x - PostProcessorWorker's thread
+ * x x
+ * xxxxxxxxxxxxxx
+ */
--
2.31.0
More information about the libcamera-devel
mailing list