From patchwork Wed Jul 29 11:12:01 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: 9068 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 7CFCBBD86F for ; Wed, 29 Jul 2020 11:12:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CCB39617AF; Wed, 29 Jul 2020 13:12:13 +0200 (CEST) Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F2D1F6039D for ; Wed, 29 Jul 2020 13:12:11 +0200 (CEST) X-Halon-ID: 560a8a70-d18c-11ea-933e-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 560a8a70-d18c-11ea-933e-005056917a89; Wed, 29 Jul 2020 13:12:05 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 29 Jul 2020 13:12:01 +0200 Message-Id: <20200729111202.3812677-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200729111202.3812677-1-niklas.soderlund@ragnatech.se> References: <20200729111202.3812677-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/3] android: camera_device: Map HAL RAW to libcamera RAW formats 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" Add a mapping from HAL RAW formats to the direct equivalent of libcamera formats. With this change it is possible to capture RAW images as long as the hardware can deliver frames in a format that is native to the HAL. More work is needed to deal with unpacked 8, 10 and 12 RAW formats as they don't directly map to a native HAL format. Nor do they belong in the RAW_OPAQUE category as the content format is generic and not uncommonly supported by hardware. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index ce37fcb8cf5cd4b3..c31950db78a588ed 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -77,6 +77,30 @@ const std::map camera3FormatsMap = { true, "IMPLEMENTATION_DEFINED" } + }, { + HAL_PIXEL_FORMAT_RAW10, { + { formats::SBGGR10_CSI2P, formats::SGBRG10_CSI2P, formats::SGRBG10_CSI2P, formats::SRGGB10_CSI2P }, + false, + "RAW10" + } + }, { + HAL_PIXEL_FORMAT_RAW12, { + { formats::SBGGR12_CSI2P, formats::SGBRG12_CSI2P, formats::SGRBG12_CSI2P, formats::SRGGB12_CSI2P }, + false, + "RAW12" + } + }, { + HAL_PIXEL_FORMAT_RAW16, { + { formats::SBGGR16, formats::SGBRG16, formats::SGRBG16, formats::SRGGB16 }, + false, + "RAW16" + } + }, { + HAL_PIXEL_FORMAT_RAW_OPAQUE, { + { formats::SBGGR10_IPU3, formats::SGBRG10_IPU3, formats::SGRBG10_IPU3, formats::SRGGB10_IPU3 }, + false, + "RAW_OPAQUE" + } }, };