[{"id":344,"web_url":"https://patchwork.libcamera.org/comment/344/","msgid":"<20190115221734.GF7393@bigcity.dyn.berto.se>","date":"2019-01-15T22:17:34","subject":"Re: [libcamera-devel] [PATCH v2 2/8] libcamera: camera_manager:\n\tImprove class documentation","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2019-01-15 17:18:43 +0200, Laurent Pinchart wrote:\n> Move documentation from the \\file directive to the CameraManager class,\n> as it documents the class, not the file. Improve the documentation to\n> provide a brief overview of how the camera manager operates, and fix a\n> few typos and inconsistencies.\n> \n> The documentation mentions hotplug even though it isn't implement yet,\n> as this is a planned feature. More improvements are needed for the\n> documentation of the CameraManager member functions, and will be added\n> as part of the API improvements in the near future.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/camera_manager.cpp | 56 +++++++++++++++++++-------------\n>  1 file changed, 34 insertions(+), 22 deletions(-)\n> \n> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n> index 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\ns/Ii/It/\n\nWith that fixed\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\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> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B8F0A60C6A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 23:17:36 +0100 (CET)","by mail-lf1-x144.google.com with SMTP id v5so3303928lfe.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 14:17:36 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tp186sm845207lfd.83.2019.01.15.14.17.35\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 15 Jan 2019 14:17:35 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=qb2v63xdrIx8dvYefX4Oe1o5Upywt82Q3/kFYOdoc60=;\n\tb=fNcWFfTp3rMGKsUtPSiMaC51dDkTNVr/vpy/CaK4vWQv/H/c+eFY6cIHQDFX97LP6q\n\tQ7f+xKWWkk6vSa7pgyxmAZwCs6JKyvdJPkbIm6/zA0N2E3ABw/bxYZ8IqL0XP18Z1g9m\n\tARFaqqFH0dMTUzx5pT5OmNpTAylJOnQcAEpETTxEGAQEu6oidspwkA5mB2jXOZWHTDBn\n\tAiKY9gLz3uv8VsO4fh6JWO0Ss9r36uYTZN0TBaBe6GydVSzhDSBVFvpUFb3drJ9REoCo\n\tLobXzw4/mtNrUPV01cxWRaSAyZhb9RNzC3dUTwDHNKZ3slF2JyCIzyvlQmVY13sqPZsG\n\t6l9g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=qb2v63xdrIx8dvYefX4Oe1o5Upywt82Q3/kFYOdoc60=;\n\tb=THAE28gDmSfjYDBHIOflwSBEL5Vsv0LB4Zt4ZNfKYlDYbfptOtSnzR62HQMBKIsCKR\n\tOovp7N40xrYiY1p1GW3ACFBKAN8sifnJ+xxeh97IEELhwVXG1BAGczrWwZZYNqPDjzJt\n\tZ3l4i2bEia8tObKvLJfSAfAhpIlI/IT7tATNh93FcpKE3c4lAEcoiPtcfENXS0JbdKG5\n\tyXX5KR5ktR5TjE6BIQywZwDNuwNUzD2qq3TC236fgW7t1EiuyHmSTFeYrAhu0qbBc3Cw\n\tq8ayAkYn0JxaHcxX8a6w2A/MyfSOgq/9t7FLFJ5m2zDx0YbEgRX1R+dpfB+IuSGkKH+X\n\tkuKA==","X-Gm-Message-State":"AJcUukevvAaBhKgBcTYumWrZM+c6G+zOylwAFTh4Nm0ijR1zammJFujo\n\tdl0m2Fm9iWAl/mlJ62r8aKLK+MpnYdk=","X-Google-Smtp-Source":"ALg8bN63kou2NoXED8bMfvaA58RcSrlJw42YbLUqyEH9uB/Eqav6WJRHTu+7Rq4GhGFS+KV8MwBOlw==","X-Received":"by 2002:a19:9508:: with SMTP id x8mr4542104lfd.112.1547590655908;\n\tTue, 15 Jan 2019 14:17:35 -0800 (PST)","Date":"Tue, 15 Jan 2019 23:17:34 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190115221734.GF7393@bigcity.dyn.berto.se>","References":"<20190115151849.1547-1-laurent.pinchart@ideasonboard.com>\n\t<20190115151849.1547-3-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190115151849.1547-3-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 2/8] libcamera: camera_manager:\n\tImprove class 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 22:17:37 -0000"}}]