Show a patch.

GET /api/patches/3588/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 3588,
    "url": "https://patchwork.libcamera.org/api/patches/3588/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3588/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20200428091934.341550-2-jacopo@jmondi.org>",
    "date": "2020-04-28T09:19:29",
    "name": "[libcamera-devel,v5,2/7] libcamera: v4l2_videodevice: Expose setSelection()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "41b2b58574bcbea8bfa06a4d8a770fa398c94ebe",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3588/mbox/",
    "series": [
        {
            "id": 842,
            "url": "https://patchwork.libcamera.org/api/series/842/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=842",
            "date": "2020-04-28T09:17:13",
            "name": "libcamera: Add CameraSensorInfo",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/842/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3588/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3588/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 8EDBD603F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 11:16:34 +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 146DF4000C;\n\tTue, 28 Apr 2020 09:16:32 +0000 (UTC)"
        ],
        "X-Originating-IP": "212.216.150.148",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 28 Apr 2020 11:19:29 +0200",
        "Message-Id": "<20200428091934.341550-2-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.26.1",
        "In-Reply-To": "<20200428091934.341550-1-jacopo@jmondi.org>",
        "References": "<20200428091934.341550-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 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": "Tue, 28 Apr 2020 09:16:34 -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\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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",
        "v5",
        "2/7"
    ]
}