From patchwork Sat Aug 29 11:54:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 9428 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 EE7ABBF019 for ; Sat, 29 Aug 2020 11:54:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BB5F16292D; Sat, 29 Aug 2020 13:54:38 +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="nga6bylE"; dkim-atps=neutral Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4952262920 for ; Sat, 29 Aug 2020 13:54:36 +0200 (CEST) Received: by mail-wr1-x442.google.com with SMTP id f7so1579457wrw.1 for ; Sat, 29 Aug 2020 04:54:36 -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=+nJuZEg21MKi4Uhs6WPxSDSjqeKRFDsK98iClUN++28=; b=nga6bylEhon7ah3PjG7rIDg1Ogoz6v8snI9rzu9Y+30tEwUjK9LjN65dmM50TXoshi jPESaesPbpppo7TLM/bQLDfWSSr7YqVFnLpd0U1gDZ/gHS2G6/9Z3svRf3a5gIQAkB2W TTV0YDsRUifMHbbBrJ+vZigVA5CZfkd/IoGfU2uyOWMiLLqHEiwFuhIuBsXOvjUAr0vj ddhLtp5LBnDYaLtb5VHVEzb1G2mpLTe8pkhVhG/5O4Evuh/Rdc46FjoE9bPaMp8dUCuO sWGiwIgXZNM9AP3QFud+ZSxjVXi9ZHJT55922efUR6I4ZpPyh3yD2Vv4jJA60GwnTHus 3C5g== 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=+nJuZEg21MKi4Uhs6WPxSDSjqeKRFDsK98iClUN++28=; b=FASM7CWLDjnLPswUG6U4gLLMyJfTeIu0tanui/lSBhN8kLPQPKhJHrcJ9zBL/DJnFK +yaELf+eSh8RXXPUN4a9iCfMcXNL+aa5Wn4uBPsWl43xeZAEfTdUdMzsjTvxj/eZ7CgJ WjkCjyhCE2VHrZF8igjeouUzhudhAW5du6RMwrxMOuZtNDEmGrTAp8k2sF4tfAu2L6CM abjGwar/Pgpp/LvfcUL46HxNvh+ANUow0gL4fPjaOhBbg3GkD5lF5hX0JErAgUUcsGqU GGtdA0Vug/NF9d5RGpMcfAS+wsmvy2+TgioWSTMcFpGjd7yQNzIfLXaIaCeRwAIvg+Oj VnzQ== X-Gm-Message-State: AOAM533/Imu1PXu8rNMxvL3GiO5MwYzXsACVxLamUZMe5EkHfWYNNLoJ y1ncLgQlQ9tM25NOtvgIXRX3RT4bF+z5PQ== X-Google-Smtp-Source: ABdhPJzr1s+t1UyJD7al9OQHQYuR4bdoTOYOqhqBVnq/5/03Qn9xlbn3UedeX9j0hcLxlGtYn1WhYg== X-Received: by 2002:a5d:5052:: with SMTP id h18mr3387666wrt.156.1598702075651; Sat, 29 Aug 2020 04:54:35 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id v16sm3071523wmj.14.2020.08.29.04.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 04:54:35 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Sat, 29 Aug 2020 12:54:23 +0100 Message-Id: <20200829115429.30010-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200829115429.30010-1-david.plowman@raspberrypi.com> References: <20200829115429.30010-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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::queryCtrl 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 --- 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..86dc05c 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 *queryControl(uint32_t id); + 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..af48107 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 id number of the V4L2 control. + * \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::queryControl(uint32_t id) +{ + const auto it = controlInfo_.find(id); + if (it == controlInfo_.end()) + return nullptr; + + return &it->second; +} + /** * \brief Retrieve the device path in sysfs *