From patchwork Wed Sep 2 10:44:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 9445 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 B1D12BF019 for ; Wed, 2 Sep 2020 10:44:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 785B3629AB; Wed, 2 Sep 2020 12:44:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="bzOZhiaL"; dkim-atps=neutral Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BAEA362984 for ; Wed, 2 Sep 2020 12:44:17 +0200 (CEST) Received: by mail-wr1-x443.google.com with SMTP id g4so4214224wrs.5 for ; Wed, 02 Sep 2020 03:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+QpAyWOuwZpuzlhf2y2xR6YOBGKUy35hWiw41rtlaM4=; b=bzOZhiaLvX59LjMCx6KSSF4e0SRbQ8ng5N4MAWwT7R11z5MgsbWwtS5sD6uI/46et7 Hkfl60qmP+i083vbV6KhGN0SWgIB5HxuUQYXG8aZvrUrQjXDqyJuYH2Ge5+DnGnkXBJ+ PkArBZ3qC8sQLQN3Aebz0FX11omluZ5RTyerw3RiKFK7IVCll/h05L475HDI7IpsOL3H y9zEQiFILkSXSsH/FilOl2aV8uXV0eg/Ecutcx/kxms+GRQnh1G6zruBGldxCOnvWtll QtXZ2IYaKb+7oqggLreIZDbY8ZjoQVtHtKIv5egyjaL4C5MF4xrNBu22MZOUtH+ozUKI aCEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+QpAyWOuwZpuzlhf2y2xR6YOBGKUy35hWiw41rtlaM4=; b=oDKZcQHfIdv0CboNVzhSyJ5o0piQ4rZCrktGuVCJaEDoaFfs5pzuznJFIa/FS4jhSO 0m58rQ7oW97CxHbfA35VQxIrBeTYy+1vny8MYKmrAWKhlm4GJRdTEWHz04WJhteH9+7b z5/G4ESEsNAnwrkMf25gHPkScF+Swb+SJJZSzKmx3p3CdEV4Fujqw7HN2ztlZbN9iOdG vh+NtBLQdH5qr7aATfimjHUn+VF+OsIDHg19C1AwDM5avZyyuH/mf9x1w+uX8orYJ5/Z 9FdaKkYfVw3+urA3FPuOQ2qKsDXMTEXZ0WNPiZZv1bkpxPI+qN6W3zo7pMmCgYF6J86S Gd7A== X-Gm-Message-State: AOAM530zO0HsVzO+NmBS39lUowzft6FbRKthPHZjwrrFk8ka67uKne2U EGIIFZ0UhTcQb3+luxcWn9iIwxcYshXNpw== X-Google-Smtp-Source: ABdhPJy0kTcInu4z0U1m1jJgtwgRy9UOK9ka47dC/NDrCLx2x1qhvR3UwiTITcGL3pFE9nT4/Yio7g== X-Received: by 2002:a5d:4bc6:: with SMTP id l6mr7024182wrt.132.1599043457281; Wed, 02 Sep 2020 03:44:17 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id m3sm5583062wmb.26.2020.09.02.03.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 03:44:16 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 2 Sep 2020 11:44:04 +0100 Message-Id: <20200902104410.7569-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200902104410.7569-1-david.plowman@raspberrypi.com> References: <20200902104410.7569-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 2/8] libcamera: Allow access to v4l2_query_ext_ctrl structure for a V4L2 control 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The V4L2Device::controInfo method simply returns a pointer to the v4l2_query_ext_ctrl structure for the given control, which has already been retrieved and stored. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/internal/v4l2_device.h | 2 ++ src/libcamera/v4l2_device.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 3b605aa..722fb72 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -29,6 +29,8 @@ public: ControlList getControls(const std::vector &ids); int setControls(ControlList *ctrls); + const struct v4l2_query_ext_ctrl *controlInfo(uint32_t id) const; + const std::string &deviceNode() const { return deviceNode_; } std::string devicePath() const; diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 65830d4..e8399c4 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -353,6 +353,21 @@ int V4L2Device::setControls(ControlList *ctrls) return ret; } +/** + * \brief Return the v4l2_query_ext_ctrl information for the given control. + * \param[in] id The V4L2 control id + * \return A pointer to the v4l2_query_ext_ctrl structure for the given + * control, or a null pointer if not found + */ +const struct v4l2_query_ext_ctrl *V4L2Device::controlInfo(uint32_t id) const +{ + const auto it = controlInfo_.find(id); + if (it == controlInfo_.end()) + return nullptr; + + return &it->second; +} + /** * \brief Retrieve the device path in sysfs *