From patchwork Fri Jul 16 10:56:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13015 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 BFB4EC3228 for ; Fri, 16 Jul 2021 10:57:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7F8386853B; Fri, 16 Jul 2021 12:57:11 +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="YVizAH5E"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A5ED36853A for ; Fri, 16 Jul 2021 12:57:08 +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 EEC8C3F0; Fri, 16 Jul 2021 12:57:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626433028; bh=JPhi8gsc1O9KCipSCk62rBUxQmfuxvdWJzFupeKUhTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YVizAH5EYzRahkCy1DnXTcc7jv+E4t9ifvB8X/NJyaROcXJBiSx0CW8oDaDFxNtj8 2fceC38vVkp09gRdrK3BDyunLG3/YBVElTZzag40l3IE64k5wOfEx6AajL0KwZ6QJ4 IrvRtfKcMpH0w3JdsUaMX8NXXNBTIlihs0Gc8c8E= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 19:56:19 +0900 Message-Id: <20210716105631.158153-10-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716105631.158153-1-paul.elder@ideasonboard.com> References: <20210716105631.158153-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v4 09/21] 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 Reviewed-by: Jacopo Mondi --- Changes in v3: - use v3 setMetadata - add comment to explain 4 - remove todo Changes in v2: - use new setMetadata - rebase on camera capabilities refactor --- src/android/camera_capabilities.cpp | 7 +++++-- src/libcamera/control_ids.yaml | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 21e31cf2..c333b329 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1127,8 +1127,11 @@ int CameraCapabilities::initializeStaticMetadata() } /* Sync static metadata. */ - int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN; - staticMetadata_->addEntry(ANDROID_SYNC_MAX_LATENCY, maxLatency); + setMetadata( + staticMetadata_.get(), ANDROID_SYNC_MAX_LATENCY, + controlsInfo, &controls::draft::MaxLatency, + ControlRange::Def, + ANDROID_SYNC_MAX_LATENCY_UNKNOWN); /* Flash static metadata. */ char flashAvailable = ANDROID_FLASH_INFO_AVAILABLE_FALSE; 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