From patchwork Fri Jan 29 06:02:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11049 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 C0171C33BB for ; Fri, 29 Jan 2021 06:03:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9274968393; Fri, 29 Jan 2021 07:03:07 +0100 (CET) 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="Lm4P2qXw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 06F9F60307 for ; Fri, 29 Jan 2021 07:03:06 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2EA7B2E0; Fri, 29 Jan 2021 07:03:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1611900185; bh=yEf/necxrywr+Rl1SLYdNYGFNiBT7WV+B8ZZ8IQk/rA=; h=From:To:Cc:Subject:Date:From; b=Lm4P2qXwG2/ydGFUFkLoV0wzR+sSqUr9jyyHdkl1Ebi83iSyWlRTrx5VMJrG2037f rf5OP7wFWma8r2rx1rg0LDToklybE947s+EfGleVO4Y4mxDAC2xg13E2wsxYv9rrkW XYes/DKby3dZTxu9B+4U5reaO6650EhOI9nIiNZU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 29 Jan 2021 15:02:55 +0900 Message-Id: <20210129060255.13613-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3] android: camera_device: Set AE precapture trigger according to request 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" Set the AE precapture triggler tag in the android result metadata according to what was passed in the request metadata. This allows the following CTS test to pass: - android.hardware.camera2.cts.StillCaptureTest#testAePrecaptureTriggerCancelJpegCapture Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi --- Changes in v3: - fix updateEntry to addEntry - move camera_metadata_ro_entry_t entry to top of the function Changes in v2: - move setting the tag to getResultMetadata() --- src/android/camera_device.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 82bf0d3a..741dc8cf 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1927,6 +1927,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, int64_t timestamp) { const ControlList &metadata = descriptor->request_->metadata(); + camera_metadata_ro_entry_t entry; /* * \todo Keep this in sync with the actual number of entries. @@ -1965,8 +1966,10 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, aeFpsTarget.data(), aeFpsTarget.size()); value = ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE; + /* \todo Handle IPA appropriately */ + bool ret = descriptor->settings_.getEntry(ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, &entry); resultMetadata->addEntry(ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, - &value, 1); + ret ? entry.data.u8 : &value, 1); value = ANDROID_CONTROL_AE_STATE_CONVERGED; resultMetadata->addEntry(ANDROID_CONTROL_AE_STATE, &value, 1); @@ -2010,8 +2013,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor, value = ANDROID_FLASH_STATE_UNAVAILABLE; resultMetadata->addEntry(ANDROID_FLASH_STATE, &value, 1); - camera_metadata_ro_entry_t entry; - int ret = descriptor->settings_.getEntry(ANDROID_LENS_APERTURE, &entry); + ret = descriptor->settings_.getEntry(ANDROID_LENS_APERTURE, &entry); if (ret) resultMetadata->addEntry(ANDROID_LENS_APERTURE, entry.data.f, 1);