From patchwork Mon Oct 11 15:11:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 14095 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 1978BC323E for ; Mon, 11 Oct 2021 15:11:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AE0E66027F; Mon, 11 Oct 2021 17:11:25 +0200 (CEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A2D56027F for ; Mon, 11 Oct 2021 17:11:22 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0CAD0E000D; Mon, 11 Oct 2021 15:11:20 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 11 Oct 2021 17:11:49 +0200 Message-Id: <20211011151154.72856-12-jacopo@jmondi.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011151154.72856-1-jacopo@jmondi.org> References: <20211011151154.72856-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 11/16] android: capabilities: Collect absolute max frame durations 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" While building the list of supported stream configurations also collect the absolute max frame durations to be used to populate the sensor maximum frame duration. Signed-off-by: Jacopo Mondi Reviewed-by: Paul Elder Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/android/camera_capabilities.cpp | 9 ++++++--- src/android/camera_capabilities.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index d29342e382e7..ddba1bbbea85 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -385,6 +385,7 @@ int CameraCapabilities::initialize(std::shared_ptr camera, orientation_ = orientation; facing_ = facing; rawStreamAvailable_ = false; + maxFrameDuration_ = 0; /* Acquire the camera and initialize available stream configurations. */ int ret = camera_->acquire(); @@ -662,6 +663,9 @@ int CameraCapabilities::initializeStreamConfigurations() }); maxJpegSize = std::max(maxJpegSize, res); } + + maxFrameDuration_ = std::max(maxFrameDuration_, + maxFrameDuration); } /* @@ -1143,9 +1147,8 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, timestampSource); - if (maxFrameDurationNsec > 0) - staticMetadata_->addEntry(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, - maxFrameDurationNsec); + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, + maxFrameDuration_); /* Statistics static metadata. */ uint8_t faceDetectMode = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF; diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index 6e55ddab445e..2cf97ae80095 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -71,6 +71,7 @@ private: int facing_; int orientation_; bool rawStreamAvailable_; + int64_t maxFrameDuration_; camera_metadata_enum_android_info_supported_hardware_level hwLevel_; std::set capabilities_;