From 124aaffde0b25d847442876beb16600d448d9feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 22 Jan 2019 16:58:40 +0100 Subject: libcamera: camera: Add disconnection notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Laurent Pinchart --- include/libcamera/camera.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/libcamera/camera.h') 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 #include +#include + namespace libcamera { class PipelineHandler; @@ -25,10 +27,15 @@ public: const std::string &name() const; + Signal disconnected; + private: Camera(PipelineHandler *pipe, const std::string &name); ~Camera(); + friend class PipelineHandler; + void disconnect(); + std::shared_ptr pipe_; std::string name_; }; -- cgit v1.2.1