Patch Detail
Show a patch.
GET /api/1.1/patches/3571/?format=api
{ "id": 3571, "url": "https://patchwork.libcamera.org/api/1.1/patches/3571/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3571/", "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": "<20200427213236.333777-3-jacopo@jmondi.org>", "date": "2020-04-27T21:32:31", "name": "[libcamera-devel,v4,2/7] libcamera: v4l2_videodevice: Expose setSelection()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "41b2b58574bcbea8bfa06a4d8a770fa398c94ebe", "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/3571/mbox/", "series": [ { "id": 837, "url": "https://patchwork.libcamera.org/api/1.1/series/837/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=837", "date": "2020-04-27T21:32:29", "name": "libcamera: Add CameraSensorInfo", "version": 4, "mbox": "https://patchwork.libcamera.org/series/837/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3571/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3571/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A761A60AF4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Apr 2020 23:29:33 +0200 (CEST)", "from uno.homenet.telecomitalia.it (a-ur1-85.tin.it\n\t[212.216.150.148]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 1D9EE4000A;\n\tMon, 27 Apr 2020 21:29:32 +0000 (UTC)" ], "X-Originating-IP": "212.216.150.148", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 27 Apr 2020 23:32:31 +0200", "Message-Id": "<20200427213236.333777-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.26.1", "In-Reply-To": "<20200427213236.333777-1-jacopo@jmondi.org>", "References": "<20200427213236.333777-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 2/7] libcamera: v4l2_videodevice:\n\tExpose setSelection()", "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": "Mon, 27 Apr 2020 21:29:33 -0000" }, "content": "Expose V4L2Videodevice::setSelection() method and drop\nV4L2Videodevice::setCrop() and V4L2Videodevice::setComopse() as wrapping\neach target with a single function does not provide any benefit.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_videodevice.h | 5 +----\n src/libcamera/v4l2_videodevice.cpp | 20 +++-----------------\n 2 files changed, 4 insertions(+), 21 deletions(-)", "diff": "diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h\nindex a0409e59c08f..976ef9b6dc50 100644\n--- a/src/libcamera/include/v4l2_videodevice.h\n+++ b/src/libcamera/include/v4l2_videodevice.h\n@@ -211,8 +211,7 @@ public:\n \tint setFormat(V4L2DeviceFormat *format);\n \tstd::map<V4L2PixelFormat, std::vector<SizeRange>> formats();\n \n-\tint setCrop(Rectangle *rect);\n-\tint setCompose(Rectangle *rect);\n+\tint setSelection(unsigned int target, Rectangle *rect);\n \n \tint allocateBuffers(unsigned int count,\n \t\t\t std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n@@ -254,8 +253,6 @@ private:\n \tstd::vector<V4L2PixelFormat> enumPixelformats();\n \tstd::vector<SizeRange> enumSizes(V4L2PixelFormat pixelFormat);\n \n-\tint setSelection(unsigned int target, Rectangle *rect);\n-\n \tint requestBuffers(unsigned int count, enum v4l2_memory memoryType);\n \tint createBuffers(unsigned int count,\n \t\t\t std::vector<std::unique_ptr<FrameBuffer>> *buffers);\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 8d642be0d05c..b16ab82c2807 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1108,25 +1108,11 @@ std::vector<SizeRange> V4L2VideoDevice::enumSizes(V4L2PixelFormat pixelFormat)\n }\n \n /**\n- * \\brief Set a crop rectangle on the V4L2 video device node\n- * \\param[inout] rect The rectangle describing the crop target area\n+ * \\brief Set a selection rectangle \\a rect for \\a target\n+ * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n+ * \\param[inout] rect The selection rectangle to be applied\n * \\return 0 on success or a negative error code otherwise\n */\n-int V4L2VideoDevice::setCrop(Rectangle *rect)\n-{\n-\treturn setSelection(V4L2_SEL_TGT_CROP, rect);\n-}\n-\n-/**\n- * \\brief Set a compose rectangle on the V4L2 video device node\n- * \\param[inout] rect The rectangle describing the compose target area\n- * \\return 0 on success or a negative error code otherwise\n- */\n-int V4L2VideoDevice::setCompose(Rectangle *rect)\n-{\n-\treturn setSelection(V4L2_SEL_TGT_COMPOSE, rect);\n-}\n-\n int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect)\n {\n \tstruct v4l2_selection sel = {};\n", "prefixes": [ "libcamera-devel", "v4", "2/7" ] }