From d4de037a8ae55f9ebf7e98782928b12490a33c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 21 Jul 2020 00:16:14 +0200 Subject: android: camera_device: Map HAL RAW to libcamera RAW formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 8028d3e1..b7b6cb19 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" + } }, }; -- cgit v1.2.1