Show a patch.

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

{
    "id": 9419,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/9419/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9419/",
    "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": "<20200828144110.17303-5-david.plowman@raspberrypi.com>",
    "date": "2020-08-28T14:41:07",
    "name": "[libcamera-devel,v4,4/7] libcamera: Add user Transform to CameraConfiguration",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "587c239ea8cecd78f3c662b29e4f35d08954a6a0",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9419/mbox/",
    "series": [
        {
            "id": 1250,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1250/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1250",
            "date": "2020-08-28T14:41:03",
            "name": "2D transforms",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/1250/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9419/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9419/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 4D2F4BF019\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Aug 2020 14:41:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F34CE62924;\n\tFri, 28 Aug 2020 16:41:22 +0200 (CEST)",
            "from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2FB84628EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Aug 2020 16:41:20 +0200 (CEST)",
            "by mail-wm1-x335.google.com with SMTP id t14so1131827wmi.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Aug 2020 07:41:20 -0700 (PDT)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\ts12sm2493724wmj.26.2020.08.28.07.41.18\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 28 Aug 2020 07:41:19 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"gx09iNxl\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Yi+HeC4pTRSEz/O01Hb068ZFqRAOPwlmJOluXXvpfGU=;\n\tb=gx09iNxlynoeJfcUEosTarbxoG1sDZwA4NchIegY32qTd4FMp6WzLsfjoOEZey1DzS\n\tVQgJfB/wcwZRo5pdsLU4G2WSFsbK5RN6ZLsoS473xmas86+c84hS/1hpMLtLTIreafq5\n\t7Uxgf1TcsoRPWaq52WXVi8NIAvAR/Q2pFmtxvxcPyvxgsvFN/hFqaEYNU6+R96qxS2l9\n\tQgJJgcOgcxvn2CndjNT114Ve9mUi1K9pdvLYBTEOyc5lLpssI7B74devhgxp7OUsvhC8\n\tejSIfxCRTpfoR5pLuhcVImVD0Ja97JGq7SeDfcTofyy7CGVOugQbaTn/h06pV+J+6f3P\n\tfuhA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Yi+HeC4pTRSEz/O01Hb068ZFqRAOPwlmJOluXXvpfGU=;\n\tb=Oq85P2lQ1YCnbeELCigmuY14xQWuLiBleziwFtDsafs4sgeh/7xl5Yq6/X501pv5K6\n\t3NkGvJAQjSoTMrBCI6sWG2iUUoi+lMDgeD5lsr2pXycRVOckU4sAErwtjfWXdg7xBGEC\n\tEPkM0ZMuquNUmlKyvkQgp5RbUoYtChwrQAIvo7XQ5py2+wwuA1Ui7axPQY6ju5Ln1dnE\n\tFp+eY+/VuLnefB9WGnG4mzbPsmQF8HPQs9JIinJWk8sd57NNFBQs2s/Ertadj+MHRpl5\n\tVo+4+0b7hgTDB2gH18aTbs1SQk1GMLSAYVhKMqMqe+uMLALbCILVnxa37qQyjRQZc3DI\n\tAOiQ==",
        "X-Gm-Message-State": "AOAM532CVtRPFrHJWpAtWr39KivIlnplGmnCEIjGdFjO0cpvTYxi4zjx\n\tMXWFksPFW9lilj4oQx2tOyBe+jVsir1bbw==",
        "X-Google-Smtp-Source": "ABdhPJwld2jiMlJc2YxRWeXA9uDoh8jZikDLVmZuyni3uUp3L96VFL7modgNzSx4VDqsV7c0LsASjQ==",
        "X-Received": "by 2002:a1c:f204:: with SMTP id s4mr2028983wmc.9.1598625679511; \n\tFri, 28 Aug 2020 07:41:19 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 28 Aug 2020 15:41:07 +0100",
        "Message-Id": "<20200828144110.17303-5-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200828144110.17303-1-david.plowman@raspberrypi.com>",
        "References": "<20200828144110.17303-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v4 4/7] libcamera: Add user Transform to\n\tCameraConfiguration",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a field to the CameraConfiguration (including the necessary\ndocumentation) to represent a 2D transform requested by the\napplication. All pipeline handlers are amended to coerce this to the\nIdentity, marking the configuration as \"adjusted\" if something\ndifferent had been requested.\n\nPipeline handlers that support Transforms can be amended subsequently.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/camera.h                       |  3 +++\n src/libcamera/camera.cpp                         | 16 +++++++++++++++-\n src/libcamera/pipeline/ipu3/ipu3.cpp             |  5 +++++\n .../pipeline/raspberrypi/raspberrypi.cpp         |  5 +++++\n src/libcamera/pipeline/rkisp1/rkisp1.cpp         |  5 +++++\n src/libcamera/pipeline/simple/simple.cpp         |  5 +++++\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp     |  5 +++++\n src/libcamera/pipeline/vimc/vimc.cpp             |  5 +++++\n 8 files changed, 48 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 272c12c..a2ee4e7 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -17,6 +17,7 @@\n #include <libcamera/request.h>\n #include <libcamera/signal.h>\n #include <libcamera/stream.h>\n+#include <libcamera/transform.h>\n \n namespace libcamera {\n \n@@ -61,6 +62,8 @@ public:\n \tbool empty() const;\n \tstd::size_t size() const;\n \n+\tTransform transform;\n+\n protected:\n \tCameraConfiguration();\n \ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 4a9c19c..b547ffe 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -93,7 +93,7 @@ LOG_DECLARE_CATEGORY(Camera)\n  * \\brief Create an empty camera configuration\n  */\n CameraConfiguration::CameraConfiguration()\n-\t: config_({})\n+\t: transform(Transform::Identity), config_({})\n {\n }\n \n@@ -250,6 +250,20 @@ std::size_t CameraConfiguration::size() const\n \treturn config_.size();\n }\n \n+/**\n+ * \\var CameraConfiguration::transform\n+ * \\brief User-specified transform to be applied to the image\n+ *\n+ * The transform is a user-specified 2D plane transform that will be applied\n+ * to the camera images by the processing pipeline before being handed to\n+ * the application. This is subsequent to any transform that is already\n+ * required to fix up any platform-defined rotation.\n+ *\n+ * The usual 2D plane transforms are allowed here (horizontal/vertical\n+ * flips, multiple of 90-degree rotations etc.), but the validate() function\n+ * may adjust this field at its discretion if the selection is not supported.\n+ */\n+\n /**\n  * \\var CameraConfiguration::config_\n  * \\brief The vector of stream configurations\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 2d881fe..22b8825 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -138,6 +138,11 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \tif (config_.empty())\n \t\treturn Invalid;\n \n+\tif (transform != Transform::Identity) {\n+\t\ttransform = Transform::Identity;\n+\t\tstatus = Adjusted;\n+\t}\n+\n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > IPU3_MAX_STREAMS) {\n \t\tconfig_.resize(IPU3_MAX_STREAMS);\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 7aace71..dc36f53 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -400,6 +400,11 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n \tif (config_.empty())\n \t\treturn Invalid;\n \n+\tif (transform != Transform::Identity) {\n+\t\ttransform = Transform::Identity;\n+\t\tstatus = Adjusted;\n+\t}\n+\n \t/*\n \t * Configure the H/V flip controls based on the sensor rotation. We do\n \t * this here so that the sensor has the correct Bayer format that will\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 4d89aab..6f53a1d 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -478,6 +478,11 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \tif (config_.empty())\n \t\treturn Invalid;\n \n+\tif (transform != Transform::Identity) {\n+\t\ttransform = Transform::Identity;\n+\t\tstatus = Adjusted;\n+\t}\n+\n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > 1) {\n \t\tconfig_.resize(1);\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex eb72e3b..10223a9 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -438,6 +438,11 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n \tif (config_.empty())\n \t\treturn Invalid;\n \n+\tif (transform != Transform::Identity) {\n+\t\ttransform = Transform::Identity;\n+\t\tstatus = Adjusted;\n+\t}\n+\n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > 1) {\n \t\tconfig_.resize(1);\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex bafe6f1..ba0efc8 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -109,6 +109,11 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()\n \tif (config_.empty())\n \t\treturn Invalid;\n \n+\tif (transform != Transform::Identity) {\n+\t\ttransform = Transform::Identity;\n+\t\tstatus = Adjusted;\n+\t}\n+\n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > 1) {\n \t\tconfig_.resize(1);\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex d192670..fc8085f 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -130,6 +130,11 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n \tif (config_.empty())\n \t\treturn Invalid;\n \n+\tif (transform != Transform::Identity) {\n+\t\ttransform = Transform::Identity;\n+\t\tstatus = Adjusted;\n+\t}\n+\n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > 1) {\n \t\tconfig_.resize(1);\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "4/7"
    ]
}