Patch Detail
Show a patch.
GET /api/1.1/patches/22334/?format=api
{ "id": 22334, "url": "https://patchwork.libcamera.org/api/1.1/patches/22334/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22334/", "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": "<20241216043954.3506855-4-paul.elder@ideasonboard.com>", "date": "2024-12-16T04:39:49", "name": "[v5,3/8] libcamera: uvcvideo: Register ExposureTimeMode control", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ce79bc06fc70402bb2ab80dad140843cf68f2d4d", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22334/mbox/", "series": [ { "id": 4892, "url": "https://patchwork.libcamera.org/api/1.1/series/4892/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4892", "date": "2024-12-16T04:39:46", "name": "AEGC controls", "version": 5, "mbox": "https://patchwork.libcamera.org/series/4892/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22334/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22334/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 B46FFC32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Dec 2024 04:40:28 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4598067F48;\n\tMon, 16 Dec 2024 05:40:28 +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 4D86C67F37\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Dec 2024 05:40:24 +0100 (CET)", "from neptunite.flets-east.jp (unknown\n\t[IPv6:2404:7a81:160:2100:c11a:e451:861f:3d32])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8EE0B7E1;\n\tMon, 16 Dec 2024 05:39:46 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"D0wABRIc\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734323988;\n\tbh=6MA9zgSpl/NUohjoXVzvi3qwaHKb6QyS95hC4Y3USaM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=D0wABRIcCtZzUtQNUq5PLFFtaPvulJaKYXx65X1L69XY8xoMiALXLC+Bm9m6N19oy\n\tmWEAII94luXWY8QKxgolYKIQvV4MXPUAN9roMlB7fuW5Mk6EcNOVJOeCXDmn/B0fhr\n\t5njKXXvsQZa9Mb6AGFf2Sj4OkjJhfdDK5B5ZePQo=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Jacopo Mondi <jacopo@jmondi.org>,\n\tPaul Elder <paul.elder@ideasonboard.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>", "Subject": "[PATCH v5 3/8] libcamera: uvcvideo: Register ExposureTimeMode\n\tcontrol", "Date": "Mon, 16 Dec 2024 13:39:49 +0900", "Message-Id": "<20241216043954.3506855-4-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.39.2", "In-Reply-To": "<20241216043954.3506855-1-paul.elder@ideasonboard.com>", "References": "<20241216043954.3506855-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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": "From: Jacopo Mondi <jacopo@jmondi.org>\n\nPort the UVC pipeline handler to use the new ExposureTimeMode control\nwhen processing Camera controls in place of the AeEnable control.\n\nThe V4L2_CID_EXPOSURE_AUTO control allows 4 possible values, which\nmap to ExposureTimeModeAuto and ExposureTimeModeManual.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v5:\n- remove unnecessary intermediate variable\n\nNo change in v3\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 53 ++++++++++++++++++--\n 1 file changed, 48 insertions(+), 5 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 8c2c6baf3575..7470b56270f6 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -298,7 +298,7 @@ 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::ExposureTime)\n \t\tcid = V4L2_CID_EXPOSURE_ABSOLUTE;\n@@ -647,7 +647,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@@ -660,6 +660,7 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \t}\n \n \t/* Map the control info. */\n+\tconst std::vector<ControlValue> &v4l2Values = v4l2Info.values();\n \tint32_t min = v4l2Info.min().get<int32_t>();\n \tint32_t max = v4l2Info.max().get<int32_t>();\n \tint32_t def = v4l2Info.def().get<int32_t>();\n@@ -697,10 +698,52 @@ void UVCCameraData::addControl(uint32_t cid, const ControlInfo &v4l2Info,\n \t\t};\n \t\tbreak;\n \n-\tcase V4L2_CID_EXPOSURE_AUTO:\n-\t\tinfo = ControlInfo{ false, true, true };\n+\tcase V4L2_CID_EXPOSURE_AUTO: {\n+\t\t/*\n+\t\t * From the V4L2_CID_EXPOSURE_AUTO documentation:\n+\t\t *\n+\t\t * ------------------------------------------------------------\n+\t\t * V4L2_EXPOSURE_AUTO:\n+\t\t * Automatic exposure time, automatic iris aperture.\n+\t\t *\n+\t\t * V4L2_EXPOSURE_MANUAL:\n+\t\t * Manual exposure time, manual iris.\n+\t\t *\n+\t\t * V4L2_EXPOSURE_SHUTTER_PRIORITY:\n+\t\t * Manual exposure time, auto iris.\n+\t\t *\n+\t\t * V4L2_EXPOSURE_APERTURE_PRIORITY:\n+\t\t * Auto exposure time, manual iris.\n+\t\t *-------------------------------------------------------------\n+\t\t *\n+\t\t * ExposureTimeModeAuto = { V4L2_EXPOSURE_AUTO,\n+\t\t * \t\t\t V4L2_EXPOSURE_APERTURE_PRIORITY }\n+\t\t *\n+\t\t *\n+\t\t * ExposureTimeModeManual = { V4L2_EXPOSURE_MANUAL,\n+\t\t *\t\t\t V4L2_EXPOSURE_SHUTTER_PRIORITY }\n+\t\t */\n+\t\tstd::array<int32_t, 2> values{};\n+\n+\t\tauto it = std::find_if(v4l2Values.begin(), v4l2Values.end(),\n+\t\t\t[&](const ControlValue &val) {\n+\t\t\t\treturn (val.get<int32_t>() == V4L2_EXPOSURE_APERTURE_PRIORITY ||\n+\t\t\t\t\tval.get<int32_t>() == V4L2_EXPOSURE_AUTO) ? true : false;\n+\t\t\t});\n+\t\tif (it != v4l2Values.end())\n+\t\t\tvalues.back() = static_cast<int32_t>(controls::ExposureTimeModeAuto);\n+\n+\t\tit = std::find_if(v4l2Values.begin(), v4l2Values.end(),\n+\t\t\t[&](const ControlValue &val) {\n+\t\t\t\treturn (val.get<int32_t>() == V4L2_EXPOSURE_SHUTTER_PRIORITY ||\n+\t\t\t\t\tval.get<int32_t>() == V4L2_EXPOSURE_MANUAL) ? true : false;\n+\t\t\t});\n+\t\tif (it != v4l2Values.end())\n+\t\t\tvalues.back() = static_cast<int32_t>(controls::ExposureTimeModeManual);\n+\n+\t\tinfo = ControlInfo{Span<int32_t>{values}, values[0]};\n \t\tbreak;\n-\n+\t}\n \tcase V4L2_CID_EXPOSURE_ABSOLUTE:\n \t\t/*\n \t\t * ExposureTime is in units of 1 µs, and UVC expects\n", "prefixes": [ "v5", "3/8" ] }