Patch Detail
Show a patch.
GET /api/1.1/patches/3594/?format=api
{ "id": 3594, "url": "https://patchwork.libcamera.org/api/1.1/patches/3594/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3594/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200428170656.21789-1-laurent.pinchart@ideasonboard.com>", "date": "2020-04-28T17:06:56", "name": "[libcamera-devel] libcamera: camera_sensor: Add model() function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "10c17e9370a2162b9fc95b3b9e223b9fe2c80f11", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3594/mbox/", "series": [ { "id": 843, "url": "https://patchwork.libcamera.org/api/1.1/series/843/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=843", "date": "2020-04-28T17:06:56", "name": "[libcamera-devel] libcamera: camera_sensor: Add model() function", "version": 1, "mbox": "https://patchwork.libcamera.org/series/843/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3594/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3594/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E2CFF60AF5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 19:07:16 +0200 (CEST)", "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F29172C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 19:07:16 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"T6vA86qT\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1588093636;\n\tbh=sdfLLYrDwhQb8UjFKAxQq4mSDwFQhEguEaIAl2l0jCE=;\n\th=From:To:Subject:Date:From;\n\tb=T6vA86qTzajSH0Uc32kXLtKttbziEvCjuQ5EKTFbtPxXvzCIgu5LIONThVj1aJYo/\n\t+ymYRMMYiJ3Xk2xd4Q3TCOAG98jn/sg0cDHlApklhNPx+ZE9+2piwEHtBGGMeif/BN\n\tyBpmkX8vdpqS5K6w886JOKH6UyF3X7/n7Y7G6XG8=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 28 Apr 2020 20:06:56 +0300", "Message-Id": "<20200428170656.21789-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.25.3", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: camera_sensor: Add model()\n\tfunction", "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>", "X-List-Received-Date": "Tue, 28 Apr 2020 17:07:17 -0000" }, "content": "Add a new model() function to the CameraSensor class to report the\ncamera sensor model.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/camera_sensor.cpp | 24 ++++++++++++++++++++++++\n src/libcamera/include/camera_sensor.h | 1 +\n 2 files changed, 25 insertions(+)\n\nJacopo,\n\nI'll need this in pipeline handlers to obtain the sensor model, in order\nto construct a configuration file name, without having to generate the\nwhole CameraSensorInfo. Is this OK with you ? As I've taken the\nimplementation of the function from your code, should I add your\nSigned-off-by ?", "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex c893b90979d8..55a9fbd71e69 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -163,6 +163,30 @@ int CameraSensor::init()\n \treturn 0;\n }\n \n+/**\n+ * \\brief Retrieve the sensor model name\n+ *\n+ * The sensor model name is a free-formed string that uniquely identifies the\n+ * sensor model.\n+ *\n+ * \\return The sensor model name\n+ */\n+std::string CameraSensor::model() const\n+{\n+\t/*\n+\t * Extract the camera sensor model name from the media entity name.\n+\t *\n+\t * \\todo There is no standardized naming scheme for sensor entities\n+\t * in the Linux kernel at the moment. The most common naming scheme\n+\t * is the one obtained by associating the sensor name and its I2C\n+\t * device and bus addresses in the form of: \"devname i2c-adapt:i2c-addr\"\n+\t * Assume this is the standard naming scheme and parse the first part\n+\t * of the entity name to obtain \"devname\".\n+\t */\n+\tstd::string entityName = subdev_->entity()->name();\n+\treturn entityName.substr(0, entityName.find(' '));\n+}\n+\n /**\n * \\fn CameraSensor::entity()\n * \\brief Retrieve the sensor media entity\ndiff --git a/src/libcamera/include/camera_sensor.h b/src/libcamera/include/camera_sensor.h\nindex 5277f7f7fe87..e68185370eb2 100644\n--- a/src/libcamera/include/camera_sensor.h\n+++ b/src/libcamera/include/camera_sensor.h\n@@ -33,6 +33,7 @@ public:\n \n \tint init();\n \n+\tstd::string model() const;\n \tconst MediaEntity *entity() const { return entity_; }\n \tconst std::vector<unsigned int> &mbusCodes() const { return mbusCodes_; }\n \tconst std::vector<Size> &sizes() const { return sizes_; }\n", "prefixes": [ "libcamera-devel" ] }