From patchwork Wed Sep 4 12:54:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1920 Return-Path: Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 765FA60BB2 for ; Wed, 4 Sep 2019 14:53:09 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 2A51624000A; Wed, 4 Sep 2019 12:53:08 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , kamesan@google.com, jcliang@google.com, shik@google.com, wtlee@google.com Date: Wed, 4 Sep 2019 14:54:25 +0200 Message-Id: <20190904125427.13943-6-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904125427.13943-1-jacopo@jmondi.org> References: <20190904125427.13943-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 5/7] android: camera: Fix handling of capture intent X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2019 12:53:09 -0000 The android control.CaptureIntent metadata tag which is returned as part of the constructed template shall depend on the template type provided to the construct_default_request_settings() HAL callback. Currently the libcamera HAL implementation fixes its value the first time the template is constructed and never updates it. Fix this by updating the metadata tag value using the provided template type. Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 969c8192c316..e96821ad523b 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -544,8 +544,18 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type) return nullptr; } - if (requestTemplate_) + if (requestTemplate_) { + camera_metadata_entry_t captureIntentEntry; + + find_camera_metadata_entry(requestTemplate_, + ANDROID_CONTROL_CAPTURE_INTENT, &captureIntentEntry); + ret = update_camera_metadata_entry(requestTemplate_, + captureIntentEntry.index, + &captureIntent, 1, &captureIntentEntry); + METADATA_ASSERT(ret); + return requestTemplate_; + } /* \todo Use correct sizes */ #define REQUEST_TEMPLATE_ENTRIES 30