From patchwork Thu Jun 30 13:38:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16470 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 9ED01BE173 for ; Thu, 30 Jun 2022 13:39:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4A56E65654; Thu, 30 Jun 2022 15:39:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656596379; bh=e6CA81XgDG0jDFZRuz9A0qOZSqW4ZunScIBZranHz68=; 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=pN7+FEk54iuBCiJG0FTqbC0kYyItI6scp546Vucuy0qSWrS0bCGeye2t+JUao8AsE hed4cjqwevePfzLyx/9W45M1JbKhjkqm5ziTRriCyeFl+d4BnNxtbzhG0fj2JLnJyk snDOq55pIQVruGfIjkpw3P23l/Q651ZcRyk7YoyXb0JviamY4z6WTc+MHH0onRYovv Cg1arSh2/femxPuYDx4DclGByZsfzIO1BFGehtxgbmcL/fHNp/TWexfVmGC7mAazDr vtjvylG0mZooSWgBXem5mylHMxNMfT7QsBBnQynu9/XQrKybsaxzACtQH/PejLey4a ux0CsrvSpiovg== Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A901365698 for ; Thu, 30 Jun 2022 15:39:32 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 5245524000E; Thu, 30 Jun 2022 13:39:30 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Thu, 30 Jun 2022 15:38:50 +0200 Message-Id: <20220630133902.321099-12-jacopo@jmondi.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630133902.321099-1-jacopo@jmondi.org> References: <20220630133902.321099-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 11/23] libcamera: camera_sensor: Expose DelayedControls interface 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: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that the CameraSensor class has an instance of delayed controls expose its interface for pipeline handlers to use it. The interface towards DelayedControls still operates on lists of V4L2 controls. Signed-off-by: Jacopo Mondi --- include/libcamera/internal/camera_sensor.h | 4 +++ src/libcamera/camera_sensor/camera_sensor.cpp | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index bd5aa0dbc27d..a606bc5d1cb5 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -71,6 +71,10 @@ public: CameraLens *focusLens() { return focusLens_.get(); } + void frameStart(uint32_t sequence); + void pushControls(const ControlList &ctrls); + ControlList getControls(uint32_t sequence); + protected: std::string logPrefix() const override; diff --git a/src/libcamera/camera_sensor/camera_sensor.cpp b/src/libcamera/camera_sensor/camera_sensor.cpp index 211c7461f5c6..e1770e8fa130 100644 --- a/src/libcamera/camera_sensor/camera_sensor.cpp +++ b/src/libcamera/camera_sensor/camera_sensor.cpp @@ -1043,6 +1043,37 @@ void CameraSensor::updateControlInfo() updateControls(); } +/** + * \brief Signal to the camera sensor class that a new frame has start exposing + * \param[in] sequence The frame sequence number + */ +void CameraSensor::frameStart(uint32_t sequence) +{ + /* A new capture session requires to start in a clean state. */ + if (sequence == 0) + delayedCtrls_->reset(); + + delayedCtrls_->applyControls(sequence); +} + +/** + * \brief Push a new set of controls to the CameraSensor + * \param[in] ctrls The list of controls to push to the sensor + */ +void CameraSensor::pushControls(const ControlList &ctrls) +{ + delayedCtrls_->push(ctrls); +} + +/** + * \brief Get the list of controls applied at frame \a sequence + * \param[in] sequence The frame sequence number + */ +ControlList CameraSensor::getControls(uint32_t sequence) +{ + return delayedCtrls_->get(sequence); +} + /** * \fn CameraSensor::focusLens() * \brief Retrieve the focus lens controller