From patchwork Sat Jul 4 13:31:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8635 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 3949ABD792 for ; Sat, 4 Jul 2020 13:32:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0928C60E35; Sat, 4 Jul 2020 15:32:24 +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="hCPxd8lT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C048B60E46 for ; Sat, 4 Jul 2020 15:32:22 +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 4C333296; Sat, 4 Jul 2020 15:32:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593869542; bh=bmIk7+yYWyNqZU0smVlTJKa8Amu5ZhDPCgO15481UKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hCPxd8lT0kgX66Bd/wpKmGgiyRFdfs+WUqeoE6qbmaLgDtuqEtlyag9EbTYi6mFdq PRiqA0pSoBGU258GUdTuqUW8J3ee9y7lfGxjGTKFR8YI2eADbJv/x82P2KX3g1HMwE /i5W+SrRHAhUKtU6KIjEXU9K6FEUwlwL/HhL4Upg= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jul 2020 22:31:32 +0900 Message-Id: <20200704133140.1738660-15-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200704133140.1738660-1-paul.elder@ideasonboard.com> References: <20200704133140.1738660-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 14/22] libcamera: pipeline: raspberrypi: Filter out unsupported formats 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" Unsupported formats should not be added to the configuration when generating the configuration. Filter them out. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- No change in v3 --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index cbb6f1c..18d068a 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -569,13 +569,11 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, /* Translate the V4L2PixelFormat to PixelFormat. */ std::map> deviceFormats; - std::transform(fmts.begin(), fmts.end(), std::inserter(deviceFormats, deviceFormats.end()), - [&](const decltype(fmts)::value_type &format) { - return decltype(deviceFormats)::value_type{ - format.first.toPixelFormat(), - format.second - }; - }); + for (auto format : fmts) { + PixelFormat pixelFormat = format.first.toPixelFormat(); + if (pixelFormat.isValid()) + deviceFormats[pixelFormat] = format.second; + } /* Add the stream format based on the device node used for the use case. */ StreamFormats formats(deviceFormats);