summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-12-19 02:21:28 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-02-01 08:11:33 +0100
commitff96eb2ebb714cef37de8e2ff19c3e56ba8bc91b (patch)
tree88394144d270860360bf807934a4e7aa52966916 /include
parent51d442d5a1c1839bb538aeca35a9451e2d325200 (diff)
libcamera: camera: Add acquire() and release()
Exclusive access must be obtained before performing operations that change the device state. Define an internal flag to track ownership and provide a means of protecting functions that change device configuration. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/camera.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
index 5ad8a09f..a2635402 100644
--- a/include/libcamera/camera.h
+++ b/include/libcamera/camera.h
@@ -29,6 +29,9 @@ public:
Signal<Camera *> disconnected;
+ int acquire();
+ void release();
+
private:
Camera(PipelineHandler *pipe, const std::string &name);
~Camera();
@@ -38,6 +41,8 @@ private:
std::shared_ptr<PipelineHandler> pipe_;
std::string name_;
+
+ bool acquired_;
};
} /* namespace libcamera */