From a77e60bf7b7a1b2b3ef8192ce8d695c971fcf1ef Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Mon, 29 Jun 2020 22:30:37 +0900 Subject: libcamera: pipeline: raspberrypi: Simplify format fetching Simplify code for looking up PixelFormatInfo using a V4L2 format by using the new PixelFormatInfo lookup function based on V4L2 format. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libcamera/pipeline/raspberrypi') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index f4966f86..1c0000bc 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -81,8 +81,7 @@ V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req) /* Calculate the closest/best mode from the user requested size. */ for (const auto &iter : formatsMap) { V4L2PixelFormat v4l2Format = iter.first; - PixelFormat pixelFormat = v4l2Format.toPixelFormat(); - const PixelFormatInfo &info = PixelFormatInfo::info(pixelFormat); + const PixelFormatInfo &info = PixelFormatInfo::info(v4l2Format); for (const SizeRange &sz : iter.second) { double modeWidth = sz.contains(req) ? req.width : sz.max.width; -- cgit v1.2.1