From 286e5fbe069cc1b2681c82c6931d3c2bd9ddc5db Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 8 Dec 2022 09:26:26 +0100 Subject: [HACK] android: Map IMPLEMENTATION_DEFINED on RGB565 Map IMPLEMENTATION_DEFINED on RGB565. In order for this to happen, the max resolution has to be limited to 1920x1080, as only the Self path can produce RGB565 and its maximum output resolution is 1080p. Signed-off-by: Jacopo Mondi --- src/android/camera_capabilities.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 268bb0df..f4fee0b4 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -85,7 +85,7 @@ const std::map camera3FormatsMap = { * usage flag. For now, copy the YCbCr_420 configuration. */ HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, { - { formats::NV12, formats::NV21 }, + { formats::RGB565 }, true, "IMPLEMENTATION_DEFINED" } @@ -500,7 +500,7 @@ int CameraCapabilities::initializeStreamConfigurations() * \todo JPEG - Adjust the maximum available resolution by taking the * JPEG encoder requirements into account (alignment and aspect ratio). */ - const Size maxRes = cfg.size; + const Size maxRes = { 1920, 1080 };//cfg.size; LOG(HAL, Debug) << "Maximum supported resolution: " << maxRes; /* @@ -517,6 +517,7 @@ int CameraCapabilities::initializeStreamConfigurations() std::back_inserter(cameraResolutions), [&](const Size &res) { return res < maxRes; }); +#if 0 /* * The Camera3 specification suggests adding 1/2 and 1/4 of the maximum * resolution. @@ -534,6 +535,7 @@ int CameraCapabilities::initializeStreamConfigurations() cameraResolutions.push_back(derivedSize); } cameraResolutions.push_back(maxRes); +#endif /* Remove duplicated entries from the list of supported resolutions. */ std::sort(cameraResolutions.begin(), cameraResolutions.end()); @@ -591,6 +593,7 @@ int CameraCapabilities::initializeStreamConfigurations() * supported formats. */ cfg.pixelFormat = pixelFormat; + cfg.size = { 1920, 1080 }; CameraConfiguration::Status status = cameraConfig->validate(); if (status != CameraConfiguration::Invalid && -- cgit v1.2.1