Patch Detail
Show a patch.
GET /api/1.1/patches/1477/?format=api
{ "id": 1477, "url": "https://patchwork.libcamera.org/api/1.1/patches/1477/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1477/", "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": "<20190619110858.20980-5-jacopo@jmondi.org>", "date": "2019-06-19T11:08:56", "name": "[libcamera-devel,v4,4/6] libcamera: camera_sensor: Add V4L2 control operations", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "0957144ecd95cc1fff51a71c62b178fdbccdad12", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1477/mbox/", "series": [ { "id": 364, "url": "https://patchwork.libcamera.org/api/1.1/series/364/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=364", "date": "2019-06-19T11:08:52", "name": "Add support for V4L2 Controls", "version": 4, "mbox": "https://patchwork.libcamera.org/series/364/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1477/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1477/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 88C9E61A3D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Jun 2019 13:07:51 +0200 (CEST)", "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 2853AFF806;\n\tWed, 19 Jun 2019 11:07:50 +0000 (UTC)" ], "X-Originating-IP": "2.224.242.101", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 19 Jun 2019 13:08:56 +0200", "Message-Id": "<20190619110858.20980-5-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190619110858.20980-1-jacopo@jmondi.org>", "References": "<20190619110858.20980-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 4/6] libcamera: camera_sensor: Add V4L2\n\tcontrol operations", "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": "Wed, 19 Jun 2019 11:07:52 -0000" }, "content": "Add operations to get and set control and to retrieve the informations\non a V4L2 control. For simple camera sensors, the operations are\ndirectly called on the underlying V4L2 subdevice.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/camera_sensor.cpp | 58 +++++++++++++++++++++++++++\n src/libcamera/include/camera_sensor.h | 6 +++\n 2 files changed, 64 insertions(+)", "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex a804a68c9d91..28a32a96ef7b 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -247,6 +247,64 @@ int CameraSensor::setFormat(V4L2SubdeviceFormat *format)\n \treturn subdev_->setFormat(0, format);\n }\n \n+/**\n+ * \\brief Retrieve the V4L2 control info from the sensor's subdevice\n+ * \\param id The V4L2 control id\n+ *\n+ * Retrieve the V4L2ControlInfo from the V4L2 subdevice backing the\n+ * camera sensor.\n+ *\n+ * More complex camera sensors, which expose multiple subdevices should\n+ * override this method.\n+ *\n+ * \\sa V4L2Device::getControlInfo()\n+ *\n+ * \\return The V4L2ControlInfo associated to the V4L2 control with \\a id or\n+ * nullptr if the control is not supported.\n+ */\n+V4L2ControlInfo *CameraSensor::getControlInfo(unsigned int id)\n+{\n+\treturn subdev_->getControlInfo(id);\n+}\n+\n+/**\n+ * \\brief Read a list of controls from the sensor's subdevice\n+ * \\param ctrls The list of controls to read\n+ *\n+ * Read V4L2 controls values on the V4L2 subdevice backing the\n+ * camera sensor.\n+ *\n+ * More complex camera sensors, which expose multiple subdevices should\n+ * override this method.\n+ *\n+ * \\sa V4L2Device::getControls()\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int CameraSensor::getControls(V4L2Controls *ctrls)\n+{\n+\treturn subdev_->getControls(ctrls);\n+}\n+\n+/**\n+ * \\brief Write a list of controls from the sensor's subdevice\n+ * \\param ctrls The list of controls to write\n+ *\n+ * Write V4L2 controls values on the V4L2 subdevice backing the\n+ * camera sensor.\n+ *\n+ * More complex camera sensors, which expose multiple subdevices should\n+ * override this method.\n+ *\n+ * \\sa V4L2Device::setControls()\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int CameraSensor::setControls(V4L2Controls *ctrls)\n+{\n+\treturn subdev_->setControls(ctrls);\n+}\n+\n std::string CameraSensor::logPrefix() const\n {\n \treturn \"'\" + subdev_->entity()->name() + \"'\";\ndiff --git a/src/libcamera/include/camera_sensor.h b/src/libcamera/include/camera_sensor.h\nindex b823480241a7..ed6bb16f5686 100644\n--- a/src/libcamera/include/camera_sensor.h\n+++ b/src/libcamera/include/camera_sensor.h\n@@ -17,6 +17,8 @@\n namespace libcamera {\n \n class MediaEntity;\n+class V4L2ControlInfo;\n+class V4L2Controls;\n class V4L2Subdevice;\n \n struct V4L2SubdeviceFormat;\n@@ -41,6 +43,10 @@ public:\n \t\t\t\t const Size &size) const;\n \tint setFormat(V4L2SubdeviceFormat *format);\n \n+\tV4L2ControlInfo *getControlInfo(unsigned int id);\n+\tint getControls(V4L2Controls *ctrls);\n+\tint setControls(V4L2Controls *ctrls);\n+\n protected:\n \tstd::string logPrefix() const;\n \n", "prefixes": [ "libcamera-devel", "v4", "4/6" ] }