Patch Detail
Show a patch.
GET /api/1.1/patches/13960/?format=api
{ "id": 13960, "url": "https://patchwork.libcamera.org/api/1.1/patches/13960/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13960/", "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": "<20210928074959.3489544-2-paul.elder@ideasonboard.com>", "date": "2021-09-28T07:49:56", "name": "[libcamera-devel,RFC,1/4] libcamera: pipeline: uvcvideo: Support the new AE controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "be4b5318187973fc799b1ea7dc4e9fd9b3a3a77f", "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/13960/mbox/", "series": [ { "id": 2578, "url": "https://patchwork.libcamera.org/api/1.1/series/2578/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2578", "date": "2021-09-28T07:49:55", "name": "Fix pipelines for the new AE-related controls", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2578/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13960/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13960/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 76164BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Sep 2021 07:50:18 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3457F69191;\n\tTue, 28 Sep 2021 09:50:18 +0200 (CEST)", "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 451E96918C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Sep 2021 09:50:16 +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 B12233F1;\n\tTue, 28 Sep 2021 09:50:14 +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=\"Szw4GfhU\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1632815415;\n\tbh=QzGM2k8AjSMrdfc0gNzEgdnJXXFC8yzw1gJYu+nieYM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Szw4GfhUMoa3V20UVSNSCFr1sZWrk/2jczkKnpZAOqhkHYRvwpA72DONvwSIqMVi5\n\tlzaw2Dxw2RvV/DCeoYNHv0TgvCg9Q8ldJk8jzOlY9YjBG1jkafNgJaYR6EZnVzvhww\n\thFkMWxQ1xWTcDKEqt+4QX8hj7YW4h6jmVoMBB60g=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 28 Sep 2021 16:49:56 +0900", "Message-Id": "<20210928074959.3489544-2-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210928074959.3489544-1-paul.elder@ideasonboard.com>", "References": "<20210928074959.3489544-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC PATCH 1/4] 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\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 35 +++++++++++++++++---\n 1 file changed, 31 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 264f5370..c227d885 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);\n+\t\t\tivalue = value.get<int32_t>() == 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>() == 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);\n+\t\t\tivalue = value.get<int32_t>() == 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>() == 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,8 @@ 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{ { ExposureTimeModeAuto, ExposureTimeModeDisabled },\n+\t\t\t\t ExposureTimeModeDisabled };\n \t\tbreak;\n \n \tcase V4L2_CID_EXPOSURE_ABSOLUTE:\n", "prefixes": [ "libcamera-devel", "RFC", "1/4" ] }