summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-12 16:20:35 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-16 18:23:43 +0200
commit6c87662ee9d56685191104f9f7e1dc8ec0df02fc (patch)
tree1ade2e8f72920e119d0c66295d6b6cabc49ce0ce /src
parent34018d23d751e4818ce407b8bec5bafb158c1bb6 (diff)
libcamera: camera_manager: Improve class documentation
Move documentation from the \file directive to the CameraManager class, as it documents the class, not the file. Improve the documentation to provide a brief overview of how the camera manager operates, and fix a few typos and inconsistencies. The documentation mentions hotplug even though it isn't implement yet, as this is a planned feature. More improvements are needed for the documentation of the CameraManager member functions, and will be added as part of the API improvements in the near future. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/camera_manager.cpp56
1 files changed, 34 insertions, 22 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index 91ef6753..2b8ef2ce 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -15,30 +15,42 @@
/**
* \file camera_manager.h
- * \brief Manage all cameras handled by libcamera
- *
- * The responsibility of the camera manager is to control the lifetime
- * management of objects provided by libcamera.
- *
- * When a user wish to interact with libcamera it creates and starts a
- * CameraManager object. Once confirmed the camera manager is running
- * the application can list all cameras detected by the library, get
- * one or more of the cameras and interact with them.
- *
- * When the user is done with the camera it should be returned to the
- * camera manager. Once all cameras are returned to the camera manager
- * the user is free to stop the manager.
- *
- * \todo Add ability to add and remove media devices based on
- * hot-(un)plug events coming from the device enumerator.
- *
- * \todo Add interface to register a notification callback to the user
- * to be able to inform it new cameras have been hot-plugged or
- * cameras have been removed due to hot-unplug.
+ * \brief The camera manager
*/
namespace libcamera {
+/**
+ * \class CameraManager
+ * \brief Provide access and manage all cameras in the system
+ *
+ * The camera manager is the entry point to libcamera. It enumerates devices,
+ * associates them with pipeline managers, and provides access to the cameras
+ * in the system to applications. The manager owns all Camera objects and
+ * handles hot-plugging and hot-unplugging to manage the lifetime of cameras.
+ *
+ * To interact with libcamera, an application retrieves the camera manager
+ * instance with CameraManager::instance(). The manager is initially stopped,
+ * and shall be configured before being started. In particular a custom event
+ * dispatcher shall be installed if needed with
+ * CameraManager::setEventDispatcher().
+ *
+ * Once the camera manager is configured, it shall be started with start().
+ * This will enumerate all the cameras present in the system, which can then be
+ * listed with list() and retrieved with get().
+ *
+ * Cameras are reference-counted, and shall be returned to the camera manager
+ * with Camera::put() after being used. Once all cameras have been returned to
+ * the manager, it can be stopped with stop().
+ *
+ * \todo Add ability to add and remove media devices based on hot-(un)plug
+ * events coming from the device enumerator.
+ *
+ * \todo Add interface to register a notification callback to the user to be
+ * able to inform it new cameras have been hot-plugged or cameras have been
+ * removed due to hot-unplug.
+ */
+
CameraManager::CameraManager()
: enumerator_(nullptr), dispatcher_(nullptr)
{
@@ -57,7 +69,7 @@ CameraManager::~CameraManager()
* interact with cameras in the system until either the camera manager
* is stopped or the camera is unplugged from the system.
*
- * \return true on successful start false otherwise
+ * \return 0 on successful start, or a negative error code otherwise
*/
int CameraManager::start()
{
@@ -102,7 +114,7 @@ int CameraManager::start()
/**
* \brief Stop the camera manager
*
- * Before stopping the camera manger the caller is responsible for making
+ * Before stopping the camera manager the caller is responsible for making
* sure all cameras provided by the manager are returned to the manager.
*
* After the manager has been stopped no resource provided by the camera