From patchwork Thu Feb 2 11:12:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 18234 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5AC61C329E for ; Thu, 2 Feb 2023 11:13:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 064FF625EB; Thu, 2 Feb 2023 12:13:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675336388; bh=tgUipenE8oUlCb1no8iYRMFLZZ7FJuEt91oSiSk9bu4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GSBitwgor1Yv/FbZ6XkX1B7BM8MiW/scfq+8axqbbT7DJoADJ8+2dXNQIWo6TLH+p oGPY1fjjgnxmL5MRRdvjGsY09daFp+gVBfreFvCY2j9CuvnqC6PpW+X9eXdyE2oJ3P 7hc8ZHLKokoF9n6jGwtVDxIh4z6umjzJQ4efZ8idPOGXDKigurZpf7p1ghvna5I+YE YgOATLk3ZzWjxpUpMbwyyBca36iVnPPcFfmouYzhjCZdY8CJp23gL59wFWx8zBs4+1 1vznLRSrvoOY2I+iucYcbRZGvHPg7OMHQjyI45wAwnADGgDhg5ux45XzU+gTXhxjUc DuuzRel6KogqA== Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8FB68625EC for ; Thu, 2 Feb 2023 12:13:04 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="X7QnafDy"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3xGQBeIlosTo1QuMaY675z/EeLWzWhTkVO4YNhiF80M=; b=X7QnafDy366Si4KVXBdfwv7zds HzbqF7qxEaIyf9KjsyJJgxq/ivGY9GjVDTzl6em2XvGg3qWD3JfI1bh3zBUHZJzQHSMowMIWDMxDm kH3N2P2QRmhB8WtXQaxlqu2J7Bony40NDgVmEm3wgLIXD5AoE8HRVxBkRyDe9pDsRtPI=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:51050 helo=localhost.localdomain) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pNXWZ-008Uhs-Rb; Thu, 02 Feb 2023 12:13:04 +0100 To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Feb 2023 12:12:50 +0100 Message-Id: <20230202111252.3366729-6-matthias.fend@emfend.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202111252.3366729-1-matthias.fend@emfend.at> References: <20230202111252.3366729-1-matthias.fend@emfend.at> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Bar: - X-Spam-Report: Spam detection software, running on the system "lx20.hoststar.hosting", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This method allows v4l2 controls to be read directly from the underlying v4l2 subdevice. Signed-off-by: Matthias Fend --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 5 +++++ 2 files changed, 6 insertions(+) Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment Subject: [libcamera-devel] [RFC PATCH 5/7] libcamera: v4l2_device: add function to get a list of volatile control ids X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Fend via libcamera-devel From: Matthias Fend Reply-To: Matthias Fend Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This method returns all IDs of the v4l2 controls that are marked as volatile. Signed-off-by: Matthias Fend --- include/libcamera/internal/v4l2_device.h | 1 + src/libcamera/v4l2_device.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 50d4adbc..1c1de64a 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -36,6 +36,7 @@ public: const ControlInfoMap &controls() const { return controls_; } + std::vector getVolatileControlIds(); ControlList getControls(const std::vector &ids); int setControls(ControlList *ctrls); diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 57a88d96..6605d36c 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -147,6 +147,21 @@ void V4L2Device::close() fd_.reset(); } +std::vector V4L2Device::getVolatileControlIds() +{ + std::vector ids; + + for (auto &[controlId, controlInfo] : controls_) { + uint32_t id = controlId->id(); + const struct v4l2_query_ext_ctrl &info = controlInfo_[id]; + + if (info.flags & V4L2_CTRL_FLAG_VOLATILE) + ids.push_back(id); + } + + return ids; +} + /** * \fn V4L2Device::isOpen() * \brief Check if the V4L2 device node is open