{"id":12372,"url":"https://patchwork.libcamera.org/api/patches/12372/?format=json","web_url":"https://patchwork.libcamera.org/patch/12372/","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":"<20210524084029.1179881-5-paul.elder@ideasonboard.com>","date":"2021-05-24T08:40:27","name":"[libcamera-devel,RFC,4/6] ipa: core: Move documentation from cpp file back into the mojom file","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"11deb97d07e67b98d3a58e35cdadb04941131ca6","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12372/mbox/","series":[{"id":2051,"url":"https://patchwork.libcamera.org/api/series/2051/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2051","date":"2021-05-24T08:40:23","name":"Generate docs from mojom files","version":1,"mbox":"https://patchwork.libcamera.org/series/2051/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12372/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12372/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CE423C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 May 2021 08:40:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 918CE68920;\n\tMon, 24 May 2021 10:40:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B05F46050E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 May 2021 10:40:47 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DF501315;\n\tMon, 24 May 2021 10:40:45 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ZR/D2m6U\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621845647;\n\tbh=yxos/G3fh7U68tx14ygrzITW+lSS9TANtRH9I71+A7M=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ZR/D2m6U0O3U5NMWxXiw/NsAXAzw51GYFGSFa+mTW3BmYV1HS8C3+h1pSv94thSRi\n\tFMvv7v4EMhTwpR3KO9L2Q9mjt96daoUgPuNeVfwDwLpSuwiUe/E5WN3Mq/qpa/lpOt\n\tY423YQG5phz8r5EhGLLhTJo1rVCaEfbKaf733yNQ=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 24 May 2021 17:40:27 +0900","Message-Id":"<20210524084029.1179881-5-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20210524084029.1179881-1-paul.elder@ideasonboard.com>","References":"<20210524084029.1179881-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 4/6] ipa: core: Move documentation\n\tfrom cpp file back into the mojom file","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Move the documentation back to the mojom file from the cpp file. Also\nremove the constructor documentation as it is not needed anymore. While\nat it, move the documentation for IPAInterface::init() and\nIPAInterface::stop() to the IPA guide.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n Documentation/guides/ipa.rst             |   6 +\n include/libcamera/ipa/core.mojom         | 200 +++++++++++++++++--\n src/libcamera/ipa/core_ipa_interface.cpp | 237 -----------------------\n 3 files changed, 190 insertions(+), 253 deletions(-)\n delete mode 100644 src/libcamera/ipa/core_ipa_interface.cpp","diff":"diff --git a/Documentation/guides/ipa.rst b/Documentation/guides/ipa.rst\nindex 6d460e13..9213c220 100644\n--- a/Documentation/guides/ipa.rst\n+++ b/Documentation/guides/ipa.rst\n@@ -166,6 +166,12 @@ At a minimum, the following three functions must be present (and implemented):\n All three of these functions are synchronous. The parameters for start() and\n init() may be customized.\n \n+init() initializes the IPA interface. It shall be called before any other\n+function of the IPAInterface.\n+\n+stop() informs the IPA module that the camera is stopped. The IPA module shall\n+release resources prepared in start().\n+\n A configure() method is recommended. Any ControlInfoMap instances that will be\n used by the IPA must be sent to the IPA from the pipeline handler, at configure\n time, for example.\ndiff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom\nindex 34a799c2..b32f3093 100644\n--- a/include/libcamera/ipa/core.mojom\n+++ b/include/libcamera/ipa/core.mojom\n@@ -2,6 +2,11 @@\n \n module libcamera;\n \n+/**\n+ * \\file core_ipa_interface.h\n+ * \\brief libcamera structs for IPAs\n+ */\n+\n /*\n  * Things that can be defined here (and in other mojom files):\n  * - consts\n@@ -78,6 +83,116 @@ module libcamera;\n \tuint32 height;\n };\n \n+/**\n+ * \\struct IPACameraSensorInfo\n+ * \\brief Report the image sensor characteristics\n+ *\n+ * The structure reports image sensor characteristics used by IPA modules to\n+ * tune their algorithms based on the image sensor model currently in use and\n+ * its configuration.\n+ *\n+ * The reported information describes the sensor's intrinsics characteristics,\n+ * such as its pixel array size and the sensor model name, as well as\n+ * information relative to the currently configured mode, such as the produced\n+ * image size and the bit depth of the requested image format.\n+ *\n+ * Instances of this structure are meant to be assembled by the CameraSensor\n+ * class by inspecting the sensor static properties as well as information\n+ * relative to the current configuration.\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::model\n+ * \\brief The image sensor model name\n+ *\n+ * The sensor model name is a free-formed string that uniquely identifies the\n+ * sensor model.\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::bitsPerPixel\n+ * \\brief The number of bits per pixel of the image format produced by the\n+ * image sensor\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::activeAreaSize\n+ * \\brief The size of the pixel array active area of the sensor\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::analogCrop\n+ * \\brief The portion of the pixel array active area which is read-out and\n+ * processed\n+ *\n+ * The analog crop rectangle top-left corner is defined as the displacement\n+ * from the top-left corner of the pixel array active area. The rectangle\n+ * horizontal and vertical sizes define the portion of the pixel array which\n+ * is read-out and provided to the sensor's internal processing pipeline, before\n+ * any pixel sub-sampling method, such as pixel binning, skipping and averaging\n+ * take place.\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::outputSize\n+ * \\brief The size of the images produced by the camera sensor\n+ *\n+ * The output image size defines the horizontal and vertical sizes of the images\n+ * produced by the image sensor. The output image size is defined as the end\n+ * result of the sensor's internal image processing pipeline stages, applied on\n+ * the pixel array portion defined by the analog crop rectangle. Each image\n+ * processing stage that performs pixel sub-sampling techniques, such as pixel\n+ * binning or skipping, or perform any additional digital scaling concur in the\n+ * definition of the output image size.\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::pixelRate\n+ * \\brief The number of pixels produced in a second\n+ *\n+ * To obtain the read-out time in seconds of a full line:\n+ *\n+ * \\verbatim\n+       lineDuration(s) = lineLength(pixels) / pixelRate(pixels per second)\n+   \\endverbatim\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::lineLength\n+ * \\brief Total line length in pixels\n+ *\n+ * The total line length in pixel clock periods, including blanking.\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::minFrameLength\n+ * \\brief The minimum allowable frame length in units of lines\n+ *\n+ * The sensor frame length comprises of active output lines and blanking lines\n+ * in a frame. The minimum frame length value dictates the minimum allowable\n+ * frame duration of the sensor mode.\n+ *\n+ * To obtain the minimum frame duration:\n+ *\n+ * \\verbatim\n+       frameDuration(s) = minFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second)\n+   \\endverbatim\n+ */\n+\n+/**\n+ * \\var IPACameraSensorInfo::maxFrameLength\n+ * \\brief The maximum allowable frame length in units of lines\n+ *\n+ * The sensor frame length comprises of active output lines and blanking lines\n+ * in a frame. The maximum frame length value dictates the maximum allowable\n+ * frame duration of the sensor mode.\n+ *\n+ * To obtain the maximum frame duration:\n+ *\n+ * \\verbatim\n+       frameDuration(s) = maxFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second)\n+   \\endverbatim\n+ */\n struct IPACameraSensorInfo {\n \tstring model;\n \n@@ -94,35 +209,88 @@ struct IPACameraSensorInfo {\n \tuint32 maxFrameLength;\n };\n \n+/**\n+ * \\struct IPABuffer\n+ * \\brief Buffer information for the IPA interface\n+ *\n+ * The IPABuffer structure associates buffer memory with a unique ID. It is\n+ * used to map buffers to the IPA with IPAInterface::mapBuffers(), after which\n+ * buffers will be identified by their ID in the IPA interface.\n+ */\n+\n+/**\n+ * \\var IPABuffer::id\n+ * \\brief The buffer unique ID\n+ *\n+ * Buffers mapped to the IPA are identified by numerical unique IDs. The IDs\n+ * are chosen by the pipeline handler to fulfil the following constraints:\n+ *\n+ * - IDs shall be positive integers different than zero\n+ * - IDs shall be unique among all mapped buffers\n+ *\n+ * When buffers are unmapped with IPAInterface::unmapBuffers() their IDs are\n+ * freed and may be reused for new buffer mappings.\n+ */\n+\n+/**\n+ * \\var IPABuffer::planes\n+ * \\brief The buffer planes description\n+ *\n+ * Stores the dmabuf handle and length for each plane of the buffer.\n+ */\n struct IPABuffer {\n \tuint32 id;\n \t[hasFd] array<FrameBuffer.Plane> planes;\n };\n \n+/**\n+ * \\struct IPASettings\n+ * \\brief IPA interface initialization settings\n+ *\n+ * The IPASettings structure stores data passed to the IPAInterface::init()\n+ * function. The data contains settings that don't depend on a particular camera\n+ * or pipeline configuration and are valid for the whole life time of the IPA\n+ * interface.\n+ */\n+\n+/**\n+ * \\var IPASettings::configurationFile\n+ * \\brief The name of the IPA configuration file\n+ *\n+ * This field may be an empty string if the IPA doesn't require a configuration\n+ * file.\n+ */\n+\n+/**\n+ * \\var IPASettings::sensorModel\n+ * \\brief The sensor model name\n+ *\n+ * Provides the sensor model name to the IPA.\n+ */\n struct IPASettings {\n \tstring configurationFile;\n \tstring sensorModel;\n };\n \n-struct IPAStream {\n-\tuint32 pixelFormat;\n-\tSize size;\n-};\n-\n /**\n- * \\fn IPAInterface::init()\n- * \\brief Initialise the IPAInterface\n- * \\param[in] settings The IPA initialization settings\n+ * \\struct IPAStream\n+ * \\brief Stream configuration for the IPA interface\n  *\n- * This function initializes the IPA interface. It shall be called before any\n- * other function of the IPAInterface. The \\a settings carry initialization\n- * parameters that are valid for the whole life time of the IPA interface.\n+ * The IPAStream structure stores stream configuration parameters needed by the\n+ * IPAInterface::configure() method. It mirrors the StreamConfiguration class\n+ * that is not suitable for this purpose due to not being serializable.\n  */\n \n /**\n- * \\fn IPAInterface::stop()\n- * \\brief Stop the IPA\n- *\n- * This method informs the IPA module that the camera is stopped. The IPA module\n- * shall release resources prepared in start().\n+ * \\var IPAStream::pixelFormat\n+ * \\brief The stream pixel format\n+ */\n+\n+/**\n+ * \\var IPAStream::size\n+ * \\brief The stream size in pixels\n  */\n+struct IPAStream {\n+\tuint32 pixelFormat;\n+\tSize size;\n+};\ndiff --git a/src/libcamera/ipa/core_ipa_interface.cpp b/src/libcamera/ipa/core_ipa_interface.cpp\ndeleted file mode 100644\nindex 47c8e93d..00000000\n--- a/src/libcamera/ipa/core_ipa_interface.cpp\n+++ /dev/null\n@@ -1,237 +0,0 @@\n-/* SPDX-License-Identifier: LGPL-2.1-or-later */\n-/*\n- * Copyright (C) 2021, Google Inc.\n- *\n- * core_ipa_interface.cpp - Docs file for core.mojom generated header\n- */\n-\n-namespace libcamera {\n-\n-/**\n- * \\struct IPABuffer\n- * \\brief Buffer information for the IPA interface\n- *\n- * The IPABuffer structure associates buffer memory with a unique ID. It is\n- * used to map buffers to the IPA with IPAInterface::mapBuffers(), after which\n- * buffers will be identified by their ID in the IPA interface.\n- */\n-\n-/**\n- * \\fn IPABuffer::IPABuffer(uint32_t id, const std::vector<FrameBuffer::Plane> &planes)\n- * \\param[in] id\n- * \\param[in] planes\n- * \\sa id and planes\n- */\n-\n-/**\n- * \\var IPABuffer::id\n- * \\brief The buffer unique ID\n- *\n- * Buffers mapped to the IPA are identified by numerical unique IDs. The IDs\n- * are chosen by the pipeline handler to fulfil the following constraints:\n- *\n- * - IDs shall be positive integers different than zero\n- * - IDs shall be unique among all mapped buffers\n- *\n- * When buffers are unmapped with IPAInterface::unmapBuffers() their IDs are\n- * freed and may be reused for new buffer mappings.\n- */\n-\n-/**\n- * \\var IPABuffer::planes\n- * \\brief The buffer planes description\n- *\n- * Stores the dmabuf handle and length for each plane of the buffer.\n- */\n-\n-/**\n- * \\struct IPASettings\n- * \\brief IPA interface initialization settings\n- *\n- * The IPASettings structure stores data passed to the IPAInterface::init()\n- * function. The data contains settings that don't depend on a particular camera\n- * or pipeline configuration and are valid for the whole life time of the IPA\n- * interface.\n- */\n-\n-/**\n- * \\fn IPASettings::IPASettings(const std::string &configurationFile, const std::string &sensorModel)\n- * \\param[in] configurationFile\n- * \\param[in] sensorModel\n- * \\sa configurationFile and sensorModel\n- */\n-\n-/**\n- * \\var IPASettings::configurationFile\n- * \\brief The name of the IPA configuration file\n- *\n- * This field may be an empty string if the IPA doesn't require a configuration\n- * file.\n- */\n-\n-/**\n- * \\var IPASettings::sensorModel\n- * \\brief The sensor model name\n- *\n- * Provides the sensor model name to the IPA.\n- */\n-\n-/**\n- * \\struct IPAStream\n- * \\brief Stream configuration for the IPA interface\n- *\n- * The IPAStream structure stores stream configuration parameters needed by the\n- * IPAInterface::configure() method. It mirrors the StreamConfiguration class\n- * that is not suitable for this purpose due to not being serializable.\n- */\n-\n-/**\n- * \\fn IPAStream::IPAStream(uint32_t pixelFormat, const Size &size)\n- * \\param[in] pixelFormat\n- * \\param[in] size\n- * \\sa pixelFormat and size\n- */\n-\n-/**\n- * \\var IPAStream::pixelFormat\n- * \\brief The stream pixel format\n- */\n-\n-/**\n- * \\var IPAStream::size\n- * \\brief The stream size in pixels\n- */\n-\n-/**\n- * \\struct IPACameraSensorInfo\n- * \\brief Report the image sensor characteristics\n- *\n- * The structure reports image sensor characteristics used by IPA modules to\n- * tune their algorithms based on the image sensor model currently in use and\n- * its configuration.\n- *\n- * The reported information describes the sensor's intrinsics characteristics,\n- * such as its pixel array size and the sensor model name, as well as\n- * information relative to the currently configured mode, such as the produced\n- * image size and the bit depth of the requested image format.\n- *\n- * Instances of this structure are meant to be assembled by the CameraSensor\n- * class by inspecting the sensor static properties as well as information\n- * relative to the current configuration.\n- */\n-\n-/**\n- * \\fn IPACameraSensorInfo::IPACameraSensorInfo(const std::string &model,\n- *                                              uint32_t bitsPerPixel,\n- *                                              const Size &activeAreaSize,\n- *                                              const Rectangle &analogCrop,\n- *                                              const Size &outputSize,\n- *                                              uint64_t pixelRate,\n- *                                              uint32_t lineLength,\n- *                                              uint32_t minFrameLength,\n- *                                              uint32_t maxFrameLength)\n- *\n- * \\param[in] model\n- * \\param[in] bitsPerPixel\n- * \\param[in] activeAreaSize\n- * \\param[in] analogCrop\n- * \\param[in] outputSize\n- * \\param[in] pixelRate\n- * \\param[in] lineLength\n- * \\param[in] minFrameLength\n- * \\param[in] maxFrameLength\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::model\n- * \\brief The image sensor model name\n- *\n- * The sensor model name is a free-formed string that uniquely identifies the\n- * sensor model.\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::bitsPerPixel\n- * \\brief The number of bits per pixel of the image format produced by the\n- * image sensor\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::activeAreaSize\n- * \\brief The size of the pixel array active area of the sensor\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::analogCrop\n- * \\brief The portion of the pixel array active area which is read-out and\n- * processed\n- *\n- * The analog crop rectangle top-left corner is defined as the displacement\n- * from the top-left corner of the pixel array active area. The rectangle\n- * horizontal and vertical sizes define the portion of the pixel array which\n- * is read-out and provided to the sensor's internal processing pipeline, before\n- * any pixel sub-sampling method, such as pixel binning, skipping and averaging\n- * take place.\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::outputSize\n- * \\brief The size of the images produced by the camera sensor\n- *\n- * The output image size defines the horizontal and vertical sizes of the images\n- * produced by the image sensor. The output image size is defined as the end\n- * result of the sensor's internal image processing pipeline stages, applied on\n- * the pixel array portion defined by the analog crop rectangle. Each image\n- * processing stage that performs pixel sub-sampling techniques, such as pixel\n- * binning or skipping, or perform any additional digital scaling concur in the\n- * definition of the output image size.\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::pixelRate\n- * \\brief The number of pixels produced in a second\n- *\n- * To obtain the read-out time in seconds of a full line:\n- *\n- * \\verbatim\n-       lineDuration(s) = lineLength(pixels) / pixelRate(pixels per second)\n-   \\endverbatim\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::lineLength\n- * \\brief Total line length in pixels\n- *\n- * The total line length in pixel clock periods, including blanking.\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::minFrameLength\n- * \\brief The minimum allowable frame length in units of lines\n- *\n- * The sensor frame length comprises of active output lines and blanking lines\n- * in a frame. The minimum frame length value dictates the minimum allowable\n- * frame duration of the sensor mode.\n- *\n- * To obtain the minimum frame duration:\n- *\n- * \\verbatim\n-       frameDuration(s) = minFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second)\n-   \\endverbatim\n- */\n-\n-/**\n- * \\var IPACameraSensorInfo::maxFrameLength\n- * \\brief The maximum allowable frame length in units of lines\n- *\n- * The sensor frame length comprises of active output lines and blanking lines\n- * in a frame. The maximum frame length value dictates the maximum allowable\n- * frame duration of the sensor mode.\n- *\n- * To obtain the maximum frame duration:\n- *\n- * \\verbatim\n-       frameDuration(s) = maxFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second)\n-   \\endverbatim\n- */\n-} /* namespace libcamera */\n","prefixes":["libcamera-devel","RFC","4/6"]}