From patchwork Thu Dec 31 10:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10792 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 5FDE5C0F1A for ; Thu, 31 Dec 2020 10:02:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ECA71615B2; Thu, 31 Dec 2020 11:02:26 +0100 (CET) Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B85776031A for ; Thu, 31 Dec 2020 11:02:25 +0100 (CET) X-Halon-ID: 45b6844f-4b4f-11eb-b73f-0050569116f7 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de [79.202.36.88]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 45b6844f-4b4f-11eb-b73f-0050569116f7; Thu, 31 Dec 2020 11:02:24 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 31 Dec 2020 11:02:18 +0100 Message-Id: <20201231100218.1365123-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: camera_device: Only advertise RAW support if RAW16 is available 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" The HAL expects RAW16 support if the RAW capability is set, add a check for this. Suggested-by: Jacopo Mondi Signed-off-by: Niklas Söderlund Tested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 7678d4485ce987b5..23be2a593a2aee5e 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1099,7 +1099,9 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() if (cameraConfig && !cameraConfig->empty()) { const PixelFormatInfo &info = PixelFormatInfo::info(cameraConfig->at(0).pixelFormat); - if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) { + /* Only advertise RAW support if RAW16 is possible. */ + if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW && + info.bitsPerPixel == 16) { rawStreamAvailable = true; availableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW); }