summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-30 23:33:43 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-07-10 16:11:19 +0900
commitbc5cd599b2c0b807ce503912d4af8750fe3b2dab (patch)
tree7c20014de7141b087e4939bd5e2492fbe0fc88c8
parent5445c7d4b2a07d52a04bedfc1ba351a87bdc7633 (diff)
libcamera: pipeline: raspberrypi: Filter out unsupported formats
Unsupported formats should not be added to the configuration when generating the configuration. Filter them out. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index cbb6f1c1..1822ac90 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);