Show a patch.

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

{
    "id": 2799,
    "url": "https://patchwork.libcamera.org/api/patches/2799/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2799/",
    "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": "<20200206185247.202233-7-jacopo@jmondi.org>",
    "date": "2020-02-06T18:52:46",
    "name": "[libcamera-devel,v2,6/7] libcamera: sensor: ov5670: Register pixel array properties",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "51d7e6a2e33047221f5e75efd3f384fdd2aaf528",
    "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/2799/mbox/",
    "series": [
        {
            "id": 664,
            "url": "https://patchwork.libcamera.org/api/series/664/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=664",
            "date": "2020-02-06T18:52:40",
            "name": "Camera sensor factory",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/664/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2799/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2799/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 E132360969\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Feb 2020 19:50:20 +0100 (CET)",
            "from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B4ECAFF802\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Feb 2020 18:50:20 +0000 (UTC)"
        ],
        "X-Originating-IP": "93.34.114.233",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  6 Feb 2020 19:52:46 +0100",
        "Message-Id": "<20200206185247.202233-7-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.24.1",
        "In-Reply-To": "<20200206185247.202233-1-jacopo@jmondi.org>",
        "References": "<20200206185247.202233-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 6/7] libcamera: sensor: ov5670:\n\tRegister pixel array properties",
        "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": "Thu, 06 Feb 2020 18:50:22 -0000"
    },
    "content": "Implement sensor specific pixel array properties initialization for the\nOV5670 sensor driver by overriding CameraSensor::initProperties()\nmethod.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/sensor/ov5670.cpp | 41 +++++++++++++++++++++++++++++++++\n src/libcamera/sensor/ov5670.h   |  3 +++\n 2 files changed, 44 insertions(+)",
    "diff": "diff --git a/src/libcamera/sensor/ov5670.cpp b/src/libcamera/sensor/ov5670.cpp\nindex de6011875a2d..a49fcebb2d9d 100644\n--- a/src/libcamera/sensor/ov5670.cpp\n+++ b/src/libcamera/sensor/ov5670.cpp\n@@ -6,6 +6,12 @@\n  */\n \n #include \"ov5670.h\"\n+\n+#include <array>\n+\n+#include <libcamera/controls.h>\n+#include <libcamera/property_ids.h>\n+\n #include \"camera_sensor.h\"\n \n /**\n@@ -38,6 +44,41 @@ OV5670CameraSensor::OV5670CameraSensor(const MediaEntity *entity)\n {\n }\n \n+/**\n+ * \\brief Initialize Camera properties with ov5670 specific values\n+ * \\param[in] controlMap The map of control information provided by the sensor\n+ * \\return 0 on success, a negative error code otherwise\n+ */\n+int OV5670CameraSensor::initProperties(const ControlInfoMap &controlMap)\n+{\n+\t/* Pixel Array Properties. */\n+\tstd::array<float, 2> pixelArraySize = { 2.9f, 1.18f };\n+\tproperties_.set(properties::PixelArraySize,\n+\t\t\tSpan<float>{ pixelArraySize });\n+\n+\tstd::array<int32_t, 2> pixelArrayBounds = { 2592, 1944 };\n+\tproperties_.set(properties::PixelArrayBounds,\n+\t\t\tSpan<int32_t>{ pixelArrayBounds });\n+\n+\tstd::array<int32_t, 2> pixelArrays = { 2592, 1944 };\n+\tproperties_.set(properties::PixelArrays,\n+\t\t\tSpan<int32_t>{ pixelArrays });\n+\n+\tstd::array<int32_t, 4> activeAreaSize = { 16, 6, 2560, 1920 };\n+\tproperties_.set(properties::ActiveAreaSize,\n+\t\t\tSpan<int32_t>{ activeAreaSize });\n+\n+\tint32_t bayerFilter = properties::BayerFilterGRBG;\n+\tproperties_.set(properties::BayerFilterArrangement, bayerFilter);\n+\n+\tstd::array<int32_t, 2> isoSensitivities = { 50, 800 };\n+\tproperties_.set(properties::ISOSensitivityRange,\n+\t\t\tSpan<int32_t>{ isoSensitivities });\n+\n+\treturn CameraSensor::initProperties(controlMap);\n+}\n+\n REGISTER_CAMERA_SENSOR(OV5670);\n \n }; /* namespace libcamera */\n+\ndiff --git a/src/libcamera/sensor/ov5670.h b/src/libcamera/sensor/ov5670.h\nindex 4acf02a8b06b..a66bdb6ae276 100644\n--- a/src/libcamera/sensor/ov5670.h\n+++ b/src/libcamera/sensor/ov5670.h\n@@ -11,12 +11,15 @@\n \n namespace libcamera {\n \n+class ControlInfoMap;\n+\n class OV5670CameraSensor final : public CameraSensor\n {\n public:\n \tstatic const char *entityName();\n \n \tOV5670CameraSensor(const MediaEntity *entity);\n+\tint initProperties(const ControlInfoMap &controlMap);\n };\n \n }; /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "6/7"
    ]
}