{"id":218,"url":"https://patchwork.libcamera.org/api/1.1/patches/218/?format=json","web_url":"https://patchwork.libcamera.org/patch/218/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190112144619.5816-3-laurent.pinchart@ideasonboard.com>","date":"2019-01-12T14:46:18","name":"[libcamera-devel,2/3] libcamera: camera_manager: Improve class documentation","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"6144ecea4ef4fee48e6b9f1f3350dcb82f894ff7","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/218/mbox/","series":[{"id":74,"url":"https://patchwork.libcamera.org/api/1.1/series/74/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=74","date":"2019-01-12T14:46:16","name":"Pipeline handler refactoring and documentation improvements","version":1,"mbox":"https://patchwork.libcamera.org/series/74/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/218/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/218/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 80B4860B2E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 12 Jan 2019 15:46:29 +0100 (CET)","from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C1676513\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 12 Jan 2019 15:46:28 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547304388;\n\tbh=w4pW37E5+lvaZ7774b5bFyHQMtHNPdOufp57opoRR7U=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=SLAOUhwN1Lck7o1+y69MCW2O03qrhQkBuN2Y4KCV4+0P6wECnsLR3d7EuIKFzyD5Z\n\tEBbFDIWKtH5NlJ6ZCbxJwnwtDL4eeWhE79Vs3vE9M1bhauWxtDyk8ZMihyKQXy69Zc\n\tN9kKY5zUUlTavl034U8d2Qr23uG80yuu/m4kKX5o=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 12 Jan 2019 16:46:18 +0200","Message-Id":"<20190112144619.5816-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.19.2","In-Reply-To":"<20190112144619.5816-1-laurent.pinchart@ideasonboard.com>","References":"<20190112144619.5816-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/3] libcamera: camera_manager: Improve\n\tclass documentation","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sat, 12 Jan 2019 14:46:29 -0000"},"content":"Move documentation from the \\file directive to the CameraManager class,\nas it documents the class, not the file. Improve the documentation to\nprovide a brief overview of how the camera manager operates, and fix a\nfew typos and inconsistencies.\n\nThe documentation mentions hotplug even though it isn't implement yet,\nas this is a planned feature. More improvements are needed for the\ndocumentation of the CameraManager member functions, and will be added\nas part of the API improvements in the near future.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/camera_manager.cpp | 56 +++++++++++++++++++-------------\n 1 file changed, 34 insertions(+), 22 deletions(-)","diff":"diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\nindex e4072529fdc4..d91ca72a3802 100644\n--- a/src/libcamera/camera_manager.cpp\n+++ b/src/libcamera/camera_manager.cpp\n@@ -15,30 +15,42 @@\n \n /**\n  * \\file camera_manager.h\n- * \\brief Manage all cameras handled by libcamera\n- *\n- * The responsibility of the camera manager is to control the lifetime\n- * management of objects provided by libcamera.\n- *\n- * When a user wish to interact with libcamera it creates and starts a\n- * CameraManager object. Once confirmed the camera manager is running\n- * the application can list all cameras detected by the library, get\n- * one or more of the cameras and interact with them.\n- *\n- * When the user is done with the camera it should be returned to the\n- * camera manager. Once all cameras are returned to the camera manager\n- * the user is free to stop the manager.\n- *\n- * \\todo Add ability to add and remove media devices based on\n- *       hot-(un)plug events coming from the device enumerator.\n- *\n- * \\todo Add interface to register a notification callback to the user\n- *       to be able to inform it new cameras have been hot-plugged or\n- *       cameras have been removed due to hot-unplug.\n+ * \\brief The camera manager\n  */\n \n namespace libcamera {\n \n+/**\n+ * \\class CameraManager\n+ * \\brief Provide access and manage all cameras in the system\n+ *\n+ * The camera manager is the entry point to libcamera. Ii enumerates devices,\n+ * associates them with pipeline managers, and provides access to the cameras\n+ * in the system to applications. The manager owns all Camera objects and\n+ * handles hot-plugging and hot-unplugging to manage the lifetime of cameras.\n+ *\n+ * To interact with libcamera, an application retrieves the camera manager\n+ * instance with CameraManager::instance(). The manager is initially stopped,\n+ * and shall be configured before being started. In particular a custom event\n+ * dispatcher shall be installed if needed with\n+ * CameraManager::setEventDispatcher().\n+ *\n+ * Once the camera manager is configured, it shall be started with start().\n+ * This will enumerate all the cameras present in the system, which can then be\n+ * listed with list() and retrieved with get().\n+ *\n+ * Cameras are reference-counted, and shall be returned to the camera manager\n+ * with Camera::put() after being used. Once all cameras have been returned to\n+ * the manager, it can be stopped with stop().\n+ *\n+ * \\todo Add ability to add and remove media devices based on hot-(un)plug\n+ * events coming from the device enumerator.\n+ *\n+ * \\todo Add interface to register a notification callback to the user to be\n+ * able to inform it new cameras have been hot-plugged or cameras have been\n+ * removed due to hot-unplug.\n+ */\n+\n CameraManager::CameraManager()\n \t: enumerator_(nullptr), dispatcher_(nullptr)\n {\n@@ -57,7 +69,7 @@ CameraManager::~CameraManager()\n  * interact with cameras in the system until either the camera manager\n  * is stopped or the camera is unplugged from the system.\n  *\n- * \\return true on successful start false otherwise\n+ * \\return 0 on successful start, or a negative error code otherwise\n  */\n int CameraManager::start()\n {\n@@ -100,7 +112,7 @@ int CameraManager::start()\n /**\n  * \\brief Stop the camera manager\n  *\n- * Before stopping the camera manger the caller is responsible for making\n+ * Before stopping the camera manager the caller is responsible for making\n  * sure all cameras provided by the manager are returned to the manager.\n  *\n  * After the manager has been stopped no resource provided by the camera\n","prefixes":["libcamera-devel","2/3"]}