From patchwork Thu Jul 9 13:28:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8722 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 20791BD792 for ; Thu, 9 Jul 2020 13:29:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E291A61218; Thu, 9 Jul 2020 15:29:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PR4xlM9Y"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B89261184 for ; Thu, 9 Jul 2020 15:29:07 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E1B20525; Thu, 9 Jul 2020 15:29:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594301346; bh=t8gZp024dC8J0AIYMufe0D//whn9nWUHr9DO9Zxkwc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PR4xlM9YvSlhGw5Y4jusXuUmwvQ3Y7nt6l1a2KofT4LFE4V631foQwi7QzrAfK5nd vlGUv9kxFjA9QloVb1wqWiMUYYjk+RUEMawKRDkMo16cPEKJMA8mY1yRVLe3zpQVBv f+7sFAEfi2ydTXnVzT1YyxL1uxzGNF9eHL/7d7fU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Jul 2020 22:28:19 +0900 Message-Id: <20200709132835.112593-8-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200709132835.112593-1-paul.elder@ideasonboard.com> References: <20200709132835.112593-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 07/23] libcamera: pipeline: raspberrypi: Simplify format fetching X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- No change in v5 No change in v4 No change in v3 Changes in v2: - just a few words in the commit message --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index f4966f8..1c0000b 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;