From patchwork Fri Jun 18 10:33:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 12635 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 2F430BD78E for ; Fri, 18 Jun 2021 10:34:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E074868943; Fri, 18 Jun 2021 12:34:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t7AdLKq8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 665CC6050D for ; Fri, 18 Jun 2021 12:34:05 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 152733E5; Fri, 18 Jun 2021 12:34:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1624012445; bh=xgJ1noi88BFzIY/jc9lyVAkhrYdLrP5AI6PVYfCe/5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t7AdLKq88wOoV3w142eHviJDrebW/dTRVWTLyfc9F73TUGt/3l+V9g/eD4oAIpq1m oOTXMUDTlXSt7/CX/n6MkUWaaKw25kdGF22iuiS3fkUmHH7Fw2pIZ4uV5nQa0wm/NS iEl9KXdif8x0dD8SR9Nh5oSCRSZjY4TFKWhnWpQ4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 18 Jun 2021 19:33:39 +0900 Message-Id: <20210618103351.1642060-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210618103351.1642060-1-paul.elder@ideasonboard.com> References: <20210618103351.1642060-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 02/14] android, controls: Add and plumb MaxLatency 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" Add a MaxLatency control, and plumb it into the HAL accordingly. Bug: https://bugs.libcamera.org/show_bug.cgi?id=50 Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 8 ++++++++ src/libcamera/control_ids.yaml | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 25dd2569..86f47e00 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1187,6 +1187,14 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() /* Sync static metadata. */ int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN; + const auto &maxLatencyInfo = controlsInfo.find(&controls::draft::MaxLatency); + if (maxLatencyInfo != controlsInfo.end()) + maxLatency = maxLatencyInfo->second.def().get(); + if (maxLatency < 0 && 4 < maxLatency) + capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE] = false; + /* \todo Double check if this is the case */ + if (maxLatency != 0) + fullSupport = false; staticMetadata_->addEntry(ANDROID_SYNC_MAX_LATENCY, maxLatency); /* Flash static metadata. */ diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index d92f29f5..9d4638ae 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -622,6 +622,16 @@ controls: detection, additional format conversions etc) count as an additional pipeline stage. + - MaxLatency: + type: int32_t + draft: true + description: | + The maximum number of frames that can occur after a request (different + than the previous) has been submitted, and before the result's state + becomes synchronized. A value of -1 indicates unknown latency, and 0 + indicates per-frame control. Currently identical to + ANDROID_SYNC_MAX_LATENCY. + - TestPatternMode: type: int32_t draft: true