summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Roumegue <xavier.roumegue@oss.nxp.com>2022-07-15 17:16:07 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-21 22:49:49 +0300
commitd4eee094e684806dbdb54fbe1bc02c9c590aa7f4 (patch)
treed5384cb701b16740814a5f2942acdfca8bf20d8c
parentcf66dee4accca7607b6c9d4461060af5275147a9 (diff)
libcamera: pipeline: simple: converter: Handle unsupported input format
SimpleConverter::formats() should return an empty vector if the input format is not supported by the converter. Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index 77c44fc8..62d173bb 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -220,6 +220,12 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)
return {};
}
+ if (v4l2Format.fourcc != V4L2PixelFormat::fromPixelFormat(input)) {
+ LOG(SimplePipeline, Debug)
+ << "Input format " << input << " not supported.";
+ return {};
+ }
+
std::vector<PixelFormat> pixelFormats;
for (const auto &format : m2m_->capture()->formats()) {