diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-29 22:30:37 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-07-10 16:11:11 +0900 |
commit | a77e60bf7b7a1b2b3ef8192ce8d695c971fcf1ef (patch) | |
tree | 1562c5184635c289b2e2530f44b84ce363c74356 | |
parent | e83727a194b5cf2e40331989bf8f762da74217fd (diff) |
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 <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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; |