[libcamera-devel] [PATCH] android: camera_device: Only advertise RAW support if RAW16 is available

Niklas Söderlund niklas.soderlund at ragnatech.se
Thu Dec 31 11:02:18 CET 2020


The HAL expects RAW16 support if the RAW capability is set, add a check
for this.

Suggested-by: Jacopo Mondi <jacopo at jmondi.org>
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 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);
 		}
-- 
2.29.2



More information about the libcamera-devel mailing list