summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2021-09-29 19:00:28 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2021-09-30 18:28:36 +0530
commit8e7feeb5e7ecc24e8dab5c5f5711210758f98b0d (patch)
tree703996f7642629c7a8aca47944b98b1e9c6356f5 /src/android/camera_device.h
parent25b0216886c70122d1e9d6a0fab35bd32a19f85a (diff)
android: camera_device: Transform descriptors_ map to queue
The descriptors_ map holds Camera3RequestDescriptor(s) which are per-capture requests placed by the framework to libcamera HAL. CameraDevice::requestComplete() looks for the descriptor for which the camera request has been completed and removes it from the map. Since the requests are placed in form of FIFO and the framework expects the order of completion to be FIFO as well, this calls for a need of a queue rather than a std::map. This patch still keeps the same lifetime of Camera3RequestDescriptor as before i.e. in the requestComplete(). Previously, a descriptor was extracted from the map and its lifetime was bound to requestComplete(). The lifetime is kept the same by manually calling .pop_front() on the queue. In the subsequent commit, this is likely to change with a centralized location of dropping descriptors from the queue for request completion. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
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 43eb5895..9ec510d5 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -10,6 +10,7 @@
#include <map>
#include <memory>
#include <mutex>
+#include <queue>
#include <vector>
#include <hardware/camera3.h>
@@ -125,7 +126,7 @@ private:
std::vector<CameraStream> streams_;
libcamera::Mutex descriptorsMutex_; /* Protects descriptors_. */
- std::map<uint64_t, Camera3RequestDescriptor> descriptors_;
+ std::queue<std::unique_ptr<Camera3RequestDescriptor>> descriptors_;
std::string maker_;
std::string model_;