[libcamera-devel] [PATCH v5 10/23] libcamera: pipeline: raspberrypi: Filter out unsupported formats
Paul Elder
paul.elder at ideasonboard.com
Thu Jul 9 15:28:22 CEST 2020
Unsupported formats should not be added to the configuration when
generating the configuration. Filter them out.
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
No change in v5
Cosmetic change in v4
No change in v3
---
src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index cbb6f1c..1822ac9 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -569,13 +569,11 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,
/* Translate the V4L2PixelFormat to PixelFormat. */
std::map<PixelFormat, std::vector<SizeRange>> deviceFormats;
- std::transform(fmts.begin(), fmts.end(), std::inserter(deviceFormats, deviceFormats.end()),
- [&](const decltype(fmts)::value_type &format) {
- return decltype(deviceFormats)::value_type{
- format.first.toPixelFormat(),
- format.second
- };
- });
+ for (const auto &format : fmts) {
+ PixelFormat pixelFormat = format.first.toPixelFormat();
+ if (pixelFormat.isValid())
+ deviceFormats[pixelFormat] = format.second;
+ }
/* Add the stream format based on the device node used for the use case. */
StreamFormats formats(deviceFormats);
--
2.27.0
More information about the libcamera-devel
mailing list