Show a patch.

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

{
    "id": 18196,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18196/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18196/",
    "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": "<20230125220826.2122375-1-kieran.bingham@ideasonboard.com>",
    "date": "2023-01-25T22:08:26",
    "name": "[libcamera-devel] pipeline: uvcvideo: Implement AeFlickerMode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "91ef4b1083098fc124e365515d4e3a0074135bed",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18196/mbox/",
    "series": [
        {
            "id": 3726,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3726/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3726",
            "date": "2023-01-25T22:08:26",
            "name": "[libcamera-devel] pipeline: uvcvideo: Implement AeFlickerMode",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3726/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18196/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18196/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 607A6BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Jan 2023 22:08:34 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A23BC625D8;\n\tWed, 25 Jan 2023 23:08:33 +0100 (CET)",
            "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 968E1603C0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Jan 2023 23:08:31 +0100 (CET)",
            "from Monstersaurus.local\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E8E9C6E0;\n\tWed, 25 Jan 2023 23:08:30 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674684513;\n\tbh=5reU1KfdwvuRTRd9ZoOcTlk5BxIA9jmRxD+xPXMHCUM=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=2R2M0FGB1uGaYVxL2Kt3IHVqtimzVaM/eiaP88NZaprYVA5AK91Aj/UKCq6aJbZnr\n\t1qUjPKnlqBG16avLLfkiPZGogGtuuTZbnJrPV+c+YeL1M0Mt7xG0fJcYpc4+fxQzGH\n\t9BJBw0iKM+Ydn4YCjQO5dTo+GR8uS2bFlYIJLwJR9EXv03D7ei5K9UtU4mWGK8f9hb\n\tjdYST+nheZ20aprDoSXGHyI8VmRtYAvFKskUmejNJKUWCfNNXI3U9JuZglLqYC9lfT\n\ti+/K9rQi+IpeJ6sCsB2f7PmHkvvUld8iVTlOs0MN8jzfvmW7ErUR+CTxq1RohIF+9e\n\tvXUmy4owcygTg==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1674684511;\n\tbh=5reU1KfdwvuRTRd9ZoOcTlk5BxIA9jmRxD+xPXMHCUM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rodpRBcudDjsMy+6L9erz4UJ+HnVrHrtpCd0BMzMd/++AXrJarK/AvIML6/h/rwFR\n\t3FmjxfX9l2efxEQNMhDA823AjTnQV4OFz0/YbEL2qI7icMUeIqSjJZqrZ0zfDZ+/9f\n\tUhez27dJXXF1lew1QuN78CGJyaI6bGa7se22MtRU="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rodpRBcu\"; dkim-atps=neutral",
        "To": "David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Wed, 25 Jan 2023 22:08:26 +0000",
        "Message-Id": "<20230125220826.2122375-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230125132018.5725-1-david.plowman@raspberrypi.com>",
        "References": "<20230125132018.5725-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] pipeline: uvcvideo: Implement\n\tAeFlickerMode",
        "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>",
        "From": "Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Implement the mapping for AeFlickerMode support.\nCustom flicker modes are not supported by UVC devices.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n\nRFC: An untested implementation of the AeFlickerMode control in the UVC\npipeline handler.\n\nAny particularly easy way to test this ?\n\nPerhaps we should be adding tests to lc-compliance for new control\ndefinitions? - Though I'm not sure how easily we can validate the\noperation of the control. But at least if it's present we can test that\nsetting it doesn't crash the pipeline or cause errors for instance.\n\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 38 ++++++++++++++++++++\n 1 file changed, 38 insertions(+)",
    "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 3afa1f8e4bc7..3a18f624a30a 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -277,6 +277,8 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t\tcid = V4L2_CID_EXPOSURE_ABSOLUTE;\n \telse if (id == controls::AnalogueGain)\n \t\tcid = V4L2_CID_GAIN;\n+\telse if (id == controls::AeFlickerMode)\n+\t\tcid = V4L2_CID_POWER_LINE_FREQUENCY;\n \telse\n \t\treturn -EINVAL;\n \n@@ -331,6 +333,30 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t\tbreak;\n \t}\n \n+\tcase V4L2_CID_POWER_LINE_FREQUENCY: {\n+\t\tenum v4l2_power_line_frequency mode;\n+\t\tswitch (value.get<int32_t>()) {\n+\t\tdefault:\n+\t\tcase controls::FlickerCustom:\n+\t\t\tLOG(UVC, Warning) << \"Unsupported AeflickerMode\";\n+\t\t\t[[fallthrough]];\n+\t\tcase controls::FlickerOff:\n+\t\t\tmode = V4L2_CID_POWER_LINE_FREQUENCY_DISABLED;\n+\t\t\tbreak;\n+\t\tcase controls::Flicker50Hz:\n+\t\t\tmode = V4L2_CID_POWER_LINE_FREQUENCY_50HZ;\n+\t\t\tbreak;\n+\t\tcase controls::Flicker60Hz:\n+\t\t\tmode = V4L2_CID_POWER_LINE_FREQUENCY_60HZ;\n+\t\t\tbreak;\n+\t\tcase controls::FlickerAuto:\n+\t\t\tmode = V4L2_CID_POWER_LINE_FREQUENCY_AUTO;\n+\t\t\tbreak;\n+\t\t}\n+\t\tcontrols->set(cid, static_cast<int32_t>(mode));\n+\t\tbreak;\n+\t}\n+\n \tdefault: {\n \t\tint32_t ivalue = value.get<int32_t>();\n \t\tcontrols->set(cid, ivalue);\n@@ -605,6 +631,9 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \tcase V4L2_CID_GAIN:\n \t\tid = &controls::AnalogueGain;\n \t\tbreak;\n+\tcase V4L2_CID_POWER_LINE_FREQUENCY:\n+\t\tid = &controls::AeFlickerMode;\n+\t\tbreak;\n \tdefault:\n \t\treturn;\n \t}\n@@ -689,6 +718,15 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \t\tbreak;\n \t}\n \n+\tcase V4L2_CID_POWER_LINE_FREQUENCY: {\n+\t\tinfo = ControlInfo{\n+\t\t\t{ static_cast<int>(controls::FlickerOff) },\n+\t\t\t{ static_cast<int>(controls::FlickerAuto) },\n+\t\t\t{ static_cast<int>(controls::FlickerOff) }\n+\t\t};\n+\t\tbreak;\n+\t}\n+\n \tdefault:\n \t\tinfo = v4l2Info;\n \t\tbreak;\n",
    "prefixes": [
        "libcamera-devel"
    ]
}