Show a patch.

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

{
    "id": 2048,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2048/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2048/",
    "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": "<20190928152238.23752-7-laurent.pinchart@ideasonboard.com>",
    "date": "2019-09-28T15:22:32",
    "name": "[libcamera-devel,06/12] libcamera: controls: Remove ControlInfo::id",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "29f347a77a3a26f3c19d8f7ac7194d9a5be90e60",
    "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/2048/mbox/",
    "series": [
        {
            "id": 511,
            "url": "https://patchwork.libcamera.org/api/1.1/series/511/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=511",
            "date": "2019-09-28T15:22:26",
            "name": "Improve the application-facing controls API",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/511/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2048/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2048/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 1CDF46165A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 28 Sep 2019 17:22:58 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B3397729\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 28 Sep 2019 17:22:57 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1569684177;\n\tbh=wZ0kluFE9GQwIOs0QGCrOMtI1+xe2JCCdoV/xFkFsLk=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=dJskqfKriRRtCDWwIoHg97S56mSGp5WJjCYNIAJlTRbt1U6tk4FbR0+hN5XkD24Sa\n\te3D66P9zdo2+OozM8rlKtY6/lw9tomqDKokQa7A+SgUqQ5bIKSUeSepgnCJiaY+0Yx\n\tz7laQNTDX3P0Ku4jmL19Hir+zcailCsedRuZvJNU=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 28 Sep 2019 18:22:32 +0300",
        "Message-Id": "<20190928152238.23752-7-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190928152238.23752-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20190928152238.23752-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 06/12] libcamera: controls: Remove\n\tControlInfo::id",
        "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": "Sat, 28 Sep 2019 15:22:59 -0000"
    },
    "content": "The ControlInfo id member is only used in the toString() method of the\nclass, and nowhere else externally. The same way that ControlValue\ndoesn't store a ControlId, ControlInfo shouldn't. Remove it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h        |  4 +---\n src/libcamera/controls.cpp          | 13 +++----------\n src/libcamera/pipeline/uvcvideo.cpp |  2 +-\n src/libcamera/pipeline/vimc.cpp     |  2 +-\n test/controls/control_info.cpp      | 18 ++----------------\n 5 files changed, 8 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex d4a74ada1b6a..854ea3b84267 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -98,17 +98,15 @@ private:\n class ControlInfo\n {\n public:\n-\texplicit ControlInfo(const ControlId &id, const ControlValue &min = 0,\n+\texplicit ControlInfo(const ControlValue &min = 0,\n \t\t\t     const ControlValue &max = 0);\n \n-\tconst ControlId &id() const { return id_; }\n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\n \n \tstd::string toString() const;\n \n private:\n-\tconst ControlId &id_;\n \tControlValue min_;\n \tControlValue max_;\n };\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 62cb2ff822bb..6a3bb353792d 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -323,22 +323,15 @@ Control<int64_t>::Control(unsigned int id, const char *name)\n \n /**\n  * \\brief Construct a ControlInfo with minimum and maximum range parameters\n- * \\param[in] id The control ID\n  * \\param[in] min The control minimum value\n  * \\param[in] max The control maximum value\n  */\n-ControlInfo::ControlInfo(const ControlId &id, const ControlValue &min,\n+ControlInfo::ControlInfo(const ControlValue &min,\n \t\t\t const ControlValue &max)\n-\t: id_(id), min_(min), max_(max)\n+\t: min_(min), max_(max)\n {\n }\n \n-/**\n- * \\fn ControlInfo::id()\n- * \\brief Retrieve the control ID\n- * \\return The control ID\n- */\n-\n /**\n  * \\fn ControlInfo::min()\n  * \\brief Retrieve the minimum value of the control\n@@ -358,7 +351,7 @@ std::string ControlInfo::toString() const\n {\n \tstd::stringstream ss;\n \n-\tss << id_.name() << \"[\" << min_.toString() << \"..\" << max_.toString() << \"]\";\n+\tss << \"[\" << min_.toString() << \"..\" << max_.toString() << \"]\";\n \n \treturn ss.str();\n }\ndiff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex 44e19f40f1b9..3635ea83a7b1 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -364,7 +364,7 @@ int UVCCameraData::init(MediaEntity *entity)\n \n \t\tcontrolInfo_.emplace(std::piecewise_construct,\n \t\t\t\t     std::forward_as_tuple(id),\n-\t\t\t\t     std::forward_as_tuple(*id, info.min(), info.max()));\n+\t\t\t\t     std::forward_as_tuple(info.min(), info.max()));\n \t}\n \n \treturn 0;\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex a48febf2172e..d9dd031e173c 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -437,7 +437,7 @@ int VimcCameraData::init(MediaDevice *media)\n \n \t\tcontrolInfo_.emplace(std::piecewise_construct,\n \t\t\t\t     std::forward_as_tuple(id),\n-\t\t\t\t     std::forward_as_tuple(*id, info.min(), info.max()));\n+\t\t\t\t     std::forward_as_tuple(info.min(), info.max()));\n \t}\n \n \treturn 0;\ndiff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp\nindex dbc43df8e3d3..9cf59185e459 100644\n--- a/test/controls/control_info.cpp\n+++ b/test/controls/control_info.cpp\n@@ -24,14 +24,7 @@ protected:\n \t\t * Test information retrieval from a control with no minimum\n \t\t * and maximum.\n \t\t */\n-\t\tControlInfo brightness(controls::Brightness);\n-\n-\t\tif (brightness.id() != controls::Brightness ||\n-\t\t    brightness.id().type() != ControlTypeInteger32 ||\n-\t\t    brightness.id().name() != std::string(\"Brightness\")) {\n-\t\t\tcout << \"Invalid control identification for Brightness\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tControlInfo brightness;\n \n \t\tif (brightness.min().get<int32_t>() != 0 ||\n \t\t    brightness.max().get<int32_t>() != 0) {\n@@ -43,14 +36,7 @@ protected:\n \t\t * Test information retrieval from a control with a minimum and\n \t\t * a maximum value.\n \t\t */\n-\t\tControlInfo contrast(controls::Contrast, 10, 200);\n-\n-\t\tif (contrast.id() != controls::Contrast ||\n-\t\t    contrast.id().type() != ControlTypeInteger32 ||\n-\t\t    contrast.id().name() != std::string(\"Contrast\")) {\n-\t\t\tcout << \"Invalid control identification for Contrast\" << endl;\n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tControlInfo contrast(10, 200);\n \n \t\tif (contrast.min().get<int32_t>() != 10 ||\n \t\t    contrast.max().get<int32_t>() != 200) {\n",
    "prefixes": [
        "libcamera-devel",
        "06/12"
    ]
}