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>
This commit is contained in:
committed by
Niklas Söderlund
parent
51d442d5a1
commit
ff96eb2ebb
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user