From patchwork Tue Jul 28 18:55:47 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: 9046 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 6C5AFBD86F for ; Tue, 28 Jul 2020 18:56:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A526D617D6; Tue, 28 Jul 2020 20:56:10 +0200 (CEST) Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 31DE0613C6 for ; Tue, 28 Jul 2020 20:56:09 +0200 (CEST) X-Halon-ID: fe5d0ac2-d103-11ea-8fb8-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id fe5d0ac2-d103-11ea-8fb8-005056917f90; Tue, 28 Jul 2020 20:56:08 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 28 Jul 2020 20:55:47 +0200 Message-Id: <20200728185548.3361465-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728185548.3361465-1-niklas.soderlund@ragnatech.se> References: <20200728185548.3361465-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 --- src/android/camera_device.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 265627a98422bd67..95a563b1aafe86de 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -73,6 +73,26 @@ const std::map camera3FormatsMap = { { formats::NV12, formats::NV21 }, "IMPLEMENTATION_DEFINED" } + }, { + HAL_PIXEL_FORMAT_RAW10, { + { formats::SBGGR10_CSI2P, formats::SGBRG10_CSI2P, formats::SGRBG10_CSI2P, formats::SRGGB10_CSI2P }, + "RAW10" + } + }, { + HAL_PIXEL_FORMAT_RAW12, { + { formats::SBGGR12_CSI2P, formats::SGBRG12_CSI2P, formats::SGRBG12_CSI2P, formats::SRGGB12_CSI2P }, + "RAW12" + } + }, { + HAL_PIXEL_FORMAT_RAW16, { + { formats::SBGGR16, formats::SGBRG16, formats::SGRBG16, formats::SRGGB16 }, + "RAW16" + } + }, { + HAL_PIXEL_FORMAT_RAW_OPAQUE, { + { formats::SBGGR10_IPU3, formats::SGBRG10_IPU3, formats::SGRBG10_IPU3, formats::SRGGB10_IPU3 }, + "RAW_OPAQUE" + } }, };