mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 16:45:07 +03:00
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>
This commit is contained in:
parent
9d29af143b
commit
124aaffde0
2 changed files with 38 additions and 0 deletions
|
@ -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_;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue