diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2022-12-08 09:26:26 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2022-12-09 08:57:42 +0100 |
commit | 286e5fbe069cc1b2681c82c6931d3c2bd9ddc5db (patch) | |
tree | e0d86ad3bf62d53a52f5cc004b1daf8df09e6aca | |
parent | 5febe445aed07a5e4b02827a2c921928208d9bfa (diff) |
[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 <jacopo@jmondi.org>
-rw-r--r-- | src/android/camera_capabilities.cpp | 7 |
1 files 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<int, const Camera3Format> 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 && |