From patchwork Wed Aug 28 14:13:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1880 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9BBF160BF6 for ; Wed, 28 Aug 2019 16:12:21 +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 relay5-d.mail.gandi.net (Postfix) with ESMTPSA id DAFCC1C0010; Wed, 28 Aug 2019 14:12:20 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , kamesan@google.com, Laurent Pinchart Date: Wed, 28 Aug 2019 16:13:43 +0200 Message-Id: <20190828141343.10237-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: camera_device: Add pipeline max depth static metadata 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, 28 Aug 2019 14:12:21 -0000 The ANDROID_REQUEST_PIPELINE_MAX_DEPTH metadata tag was wrongly reported in the capture settings template, while it is actually a static camera metadata. As of Chromium R78 the absence of this specific metadata tag causes a system crash. Fix this by reporting the maximum pipeline depth in the static metadata pack and set its value to 1 as currently no control is applied to the image capture pipeline. Reported-by: Laurent Pinchart Suggested-by: Ren-Pei Zeng Signed-off-by: Jacopo Mondi Tested-by: Laurent Pinchart --- Laurent, as you're running R78 and first reported the crash, could you please give this a spin and report if the issue is still present? --- src/android/camera_device.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.23.0 diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index c27175ac090d..7c69d0810eee 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -281,6 +281,13 @@ camera_metadata_t *CameraDevice::getStaticMetadata() ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, &supportedHWLevel, 1); + /* Request static metadata. */ + uint8_t maxPipelineDepth = 1; + ret = add_camera_metadata_entry(staticMetadata_, + ANDROID_REQUEST_PIPELINE_MAX_DEPTH, + &maxPipelineDepth, 1); + METADATA_ASSERT(ret); + return staticMetadata_; } @@ -340,12 +347,6 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type) maxOutStream, 3); METADATA_ASSERT(ret); - uint8_t maxPipelineDepth = 5; - ret = add_camera_metadata_entry(requestTemplate_, - ANDROID_REQUEST_PIPELINE_MAX_DEPTH, - &maxPipelineDepth, 1); - METADATA_ASSERT(ret); - int32_t inputStreams = 0; ret = add_camera_metadata_entry(requestTemplate_, ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS,