summaryrefslogtreecommitdiff
path: root/include/libcamera/camera.h
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-01-22 16:58:40 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-24 22:24:15 +0200
commit124aaffde0b25d847442876beb16600d448d9feb (patch)
treeb8c940e77dba880331d6645181eea8660f03dd29 /include/libcamera/camera.h
parent9d29af143b6b91dfe34c7a302c12a077561438c5 (diff)
libcamera: camera: Add disconnection notification
As camera object have the potential to outlive the hardware they represent, there is a need to inform the camera that the underlying device has been disconnected, and in turn to notify applications. Implement a disconnection notification mechanism that can be used by pipeline handlers to notify the camera of disconnection. The camera then block all new API calls and emit the disconnected signal. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include/libcamera/camera.h')
-rw-r--r--include/libcamera/camera.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
index efafb9e2..a2ded62d 100644
--- a/include/libcamera/camera.h
+++ b/include/libcamera/camera.h
@@ -10,6 +10,8 @@
#include <memory>
#include <string>
+#include <libcamera/signal.h>
+
namespace libcamera {
class PipelineHandler;
@@ -25,10 +27,15 @@ public:
const std::string &name() const;
+ Signal<Camera *> disconnected;
+
private:
Camera(PipelineHandler *pipe, const std::string &name);
~Camera();
+ friend class PipelineHandler;
+ void disconnect();
+
std::shared_ptr<PipelineHandler> pipe_;
std::string name_;
};