Show a patch.

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

{
    "id": 14017,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14017/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14017/",
    "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": "<20211001103325.1077590-3-paul.elder@ideasonboard.com>",
    "date": "2021-10-01T10:33:20",
    "name": "[libcamera-devel,v2,2/7] libcamera: pipeline: uvcvideo: Support the new AE controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "930324cffd54c06028552023e18b6e49a1e241b7",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/users/17/?format=api",
        "username": "epaul",
        "first_name": "Paul",
        "last_name": "Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/14017/mbox/",
    "series": [
        {
            "id": 2589,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2589/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2589",
            "date": "2021-10-01T10:33:18",
            "name": "The Great AE Changes",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2589/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14017/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14017/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 94703BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  1 Oct 2021 10:33:43 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 52610691B3;\n\tFri,  1 Oct 2021 12:33:43 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E2A51691B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Oct 2021 12:33:40 +0200 (CEST)",
            "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 71652596;\n\tFri,  1 Oct 2021 12:33:39 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"PH2FAj6Q\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633084420;\n\tbh=97M0rv3Sn0paTSe4Y0O7q9AzQaH/dcm29+dgj7mOcKc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PH2FAj6QwFVWVb0g+AQI2U7avDES5Ed9i0chEZxM90Wqa+rjIAd9GwmWP4Zanl7Gg\n\tbAJVrDpSWhrZ5ODDyDq99f8W8V94vrmfQ86pbb5qVED1oooZckZscL2Q3sTFDwR9jf\n\t4pM7BIOmWT5Hg406wxxKxCn4q3cUVRTx5aXuk6jI=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  1 Oct 2021 19:33:20 +0900",
        "Message-Id": "<20211001103325.1077590-3-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20211001103325.1077590-1-paul.elder@ideasonboard.com>",
        "References": "<20211001103325.1077590-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/7] libcamera: pipeline: uvcvideo:\n\tSupport the new AE controls",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add support for the new AE controls in the uvcvideo pipeline handler.\n\nBug: https://bugs.libcamera.org/show_bug.cgi?id=42\nBug: https://bugs.libcamera.org/show_bug.cgi?id=43\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v2:\n- fix the rebase error where some uvc stuff was in rasberrypi\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 36 +++++++++++++++++---\n 1 file changed, 32 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 264f5370..3a9c3b8d 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -268,7 +268,9 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t\tcid = V4L2_CID_CONTRAST;\n \telse if (id == controls::Saturation)\n \t\tcid = V4L2_CID_SATURATION;\n-\telse if (id == controls::AeEnable)\n+\telse if (id == controls::ExposureTimeMode)\n+\t\tcid = V4L2_CID_EXPOSURE_AUTO;\n+\telse if (id == controls::AnalogueGainMode)\n \t\tcid = V4L2_CID_EXPOSURE_AUTO;\n \telse if (id == controls::ExposureTime)\n \t\tcid = V4L2_CID_EXPOSURE_ABSOLUTE;\n@@ -302,9 +304,33 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n \t}\n \n \tcase V4L2_CID_EXPOSURE_AUTO: {\n-\t\tint32_t ivalue = value.get<bool>()\n+\t\tbool exposureSet = controls->contains(V4L2_CID_EXPOSURE_AUTO);\n+\n+\t\t/* \\todo Make this nicer. */\n+\t\tint32_t ivalue;\n+\t\tif (id == controls::ExposureTimeMode && exposureSet) {\n+\t\t\tint32_t exposureMode = controls->get(V4L2_CID_EXPOSURE_AUTO).get<int32_t>();\n+\t\t\tivalue = value.get<int32_t>() == controls::ExposureTimeModeAuto\n+\t\t\t       ? (exposureMode == V4L2_EXPOSURE_SHUTTER_PRIORITY\n+\t\t\t\t  ? V4L2_EXPOSURE_AUTO\n+\t\t\t\t  : V4L2_EXPOSURE_APERTURE_PRIORITY)\n+\t\t\t       : V4L2_EXPOSURE_MANUAL;\n+\t\t} else if (id == controls::ExposureTimeMode && !exposureSet) {\n+\t\t\tivalue = value.get<int32_t>() == controls::ExposureTimeModeAuto\n \t\t\t       ? V4L2_EXPOSURE_APERTURE_PRIORITY\n \t\t\t       : V4L2_EXPOSURE_MANUAL;\n+\t\t} else if (id == controls::AnalogueGainMode && exposureSet) {\n+\t\t\tint32_t exposureMode = controls->get(V4L2_CID_EXPOSURE_AUTO).get<int32_t>();\n+\t\t\tivalue = value.get<int32_t>() == controls::AnalogueGainModeAuto\n+\t\t\t       ? (exposureMode == V4L2_EXPOSURE_APERTURE_PRIORITY\n+\t\t\t\t  ? V4L2_EXPOSURE_AUTO\n+\t\t\t\t  : V4L2_EXPOSURE_SHUTTER_PRIORITY)\n+\t\t\t       : V4L2_EXPOSURE_MANUAL;\n+\t\t} else if (id == controls::AnalogueGainMode && !exposureSet) {\n+\t\t\tivalue = value.get<int32_t>() == controls::AnalogueGainModeAuto\n+\t\t\t       ? V4L2_EXPOSURE_SHUTTER_PRIORITY\n+\t\t\t       : V4L2_EXPOSURE_MANUAL;\n+\t\t}\n \t\tcontrols->set(V4L2_CID_EXPOSURE_AUTO, ivalue);\n \t\tbreak;\n \t}\n@@ -559,7 +585,7 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \t\tid = &controls::Saturation;\n \t\tbreak;\n \tcase V4L2_CID_EXPOSURE_AUTO:\n-\t\tid = &controls::AeEnable;\n+\t\tid = &controls::ExposureTimeMode;\n \t\tbreak;\n \tcase V4L2_CID_EXPOSURE_ABSOLUTE:\n \t\tid = &controls::ExposureTime;\n@@ -610,7 +636,9 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \t\tbreak;\n \n \tcase V4L2_CID_EXPOSURE_AUTO:\n-\t\tinfo = ControlInfo{ false, true, true };\n+\t\tinfo = ControlInfo{ { controls::ExposureTimeModeAuto,\n+\t\t\t\t      controls::ExposureTimeModeDisabled },\n+\t\t\t\t    controls::ExposureTimeModeDisabled };\n \t\tbreak;\n \n \tcase V4L2_CID_EXPOSURE_ABSOLUTE:\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/7"
    ]
}