From patchwork Sat Aug 1 10:14:26 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: 9131 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 1D412BD86F for ; Sat, 1 Aug 2020 10:15:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EB7F561F24; Sat, 1 Aug 2020 12:15:12 +0200 (CEST) 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 E28AC61F2E for ; Sat, 1 Aug 2020 12:15:10 +0200 (CEST) X-Halon-ID: b1755dad-d3df-11ea-86ee-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id b1755dad-d3df-11ea-86ee-0050569116f7; Sat, 01 Aug 2020 12:13:50 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sat, 1 Aug 2020 12:14:26 +0200 Message-Id: <20200801101427.1540331-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200801101427.1540331-1-niklas.soderlund@ragnatech.se> References: <20200801101427.1540331-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 8028d3e12bda1316..b7b6cb19426d8760 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -77,6 +77,50 @@ 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" + } }, };