summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/camera_manager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index 50a805fc..1a9d2f38 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -161,4 +161,19 @@ Camera *CameraManager::get(const std::string &name)
return nullptr;
}
+/**
+ * \brief Retrieve the camera manager instance
+ *
+ * The CameraManager is a singleton and can't be constructed manually. This
+ * function shall instead be used to retrieve the single global instance of the
+ * manager.
+ *
+ * \return The camera manager instance
+ */
+CameraManager *CameraManager::instance()
+{
+ static CameraManager manager;
+ return &manager;
+}
+
} /* namespace libcamera */