pipeline: raspberrypi: Detect monochrome "R" formats as being raw

The "R" pixel formats (R8, R10, R10_CSI2P etc.) record the associated
colour space as being YUV rather than RAW, meaning that the code was
not detecting them as being raw formats.

In the case of Raspberry Pi, we deal only with raw formats, so the
revised test must work correctly for both these and the standard Bayer
formats.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
David Plowman 2022-08-15 15:16:37 +01:00 committed by Laurent Pinchart
parent e730867873
commit 12f4708e35

View file

@ -105,18 +105,8 @@ V4L2DeviceFormat toV4L2DeviceFormat(const V4L2VideoDevice *dev,
bool isRaw(const PixelFormat &pixFmt) bool isRaw(const PixelFormat &pixFmt)
{ {
/* /* This test works for both Bayer and raw mono formats. */
* The isRaw test might be redundant right now the pipeline handler only return BayerFormat::fromPixelFormat(pixFmt).isValid();
* supports RAW sensors. Leave it in for now, just as a sanity check.
*/
if (!pixFmt.isValid())
return false;
const PixelFormatInfo &info = PixelFormatInfo::info(pixFmt);
if (!info.isValid())
return false;
return info.colourEncoding == PixelFormatInfo::ColourEncodingRAW;
} }
double scoreFormat(double desired, double actual) double scoreFormat(double desired, double actual)