{"id":234,"url":"https://patchwork.libcamera.org/api/patches/234/?format=json","web_url":"https://patchwork.libcamera.org/patch/234/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20190115151849.1547-3-laurent.pinchart@ideasonboard.com>","date":"2019-01-15T15:18:43","name":"[libcamera-devel,v2,2/8] 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/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/234/mbox/","series":[{"id":81,"url":"https://patchwork.libcamera.org/api/series/81/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=81","date":"2019-01-15T15:18:41","name":"Pipeline handler refactoring and assorted improvements","version":2,"mbox":"https://patchwork.libcamera.org/series/81/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/234/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/234/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 9550C60C85\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 16:18:53 +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 D63AC4F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 16:18:52 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547565533;\n\tbh=PvkPS50fI1Ol84OE9MuOboJ5l+cRC6A2bdw/QI26BS4=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=MGNdMV0NeYO/rUZ+CZrps+BjkFH5D6MskxrOedwvxN50pM5ZYaYedg+BSIRHWc6U1\n\tu0tJQthuaKhsWXGfp4NwaulVaf2X0GEadfwst5S3AwlbbHWzpsdLcM3YVA0t1x5DfK\n\tNJUVs5OFRBqhpIRGmua/vPRDbwC4S3JkJQNfiu6c=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 15 Jan 2019 17:18:43 +0200","Message-Id":"<20190115151849.1547-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.19.2","In-Reply-To":"<20190115151849.1547-1-laurent.pinchart@ideasonboard.com>","References":"<20190115151849.1547-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 2/8] 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":"Tue, 15 Jan 2019 15:18:53 -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>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\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 91ef6753f405..4313994e97c8 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@@ -102,7 +114,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","v2","2/8"]}