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>
This commit is contained in:
Xavier Roumegue 2022-07-15 17:16:07 +02:00 committed by Laurent Pinchart
parent cf66dee4ac
commit d4eee094e6

View file

@ -220,6 +220,12 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)
return {}; return {};
} }
if (v4l2Format.fourcc != V4L2PixelFormat::fromPixelFormat(input)) {
LOG(SimplePipeline, Debug)
<< "Input format " << input << " not supported.";
return {};
}
std::vector<PixelFormat> pixelFormats; std::vector<PixelFormat> pixelFormats;
for (const auto &format : m2m_->capture()->formats()) { for (const auto &format : m2m_->capture()->formats()) {