From patchwork Wed Mar 18 03:31:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 3157 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 211E2629AA for ; Wed, 18 Mar 2020 04:32:38 +0100 (CET) X-Halon-ID: 1ce32bb3-68c9-11ea-9f85-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 1ce32bb3-68c9-11ea-9f85-005056917a89; Wed, 18 Mar 2020 04:32:37 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 18 Mar 2020 04:31:56 +0100 Message-Id: <20200318033200.3042855-5-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200318033200.3042855-1-niklas.soderlund@ragnatech.se> References: <20200318033200.3042855-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/8] libcamera: pipeline: vimc: Remove internal usage of ImageFormats 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: , X-List-Received-Date: Wed, 18 Mar 2020 03:32:39 -0000 There is no need to use the ImageFormats helper to generate a map of PixelFormat to sizes, use std::map directly. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/vimc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index de2458afff3a4784..04cad94e739e9ae9 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -172,17 +172,17 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera, if (roles.empty()) return config; - ImageFormats formats; + std::map> formats; for (PixelFormat pixelformat : pixelformats) { /* The scaler hardcodes a x3 scale-up ratio. */ std::vector sizes{ SizeRange{ 48, 48, 4096, 2160 } }; - formats.addFormat(pixelformat, sizes); + formats[pixelformat] = sizes; } - StreamConfiguration cfg(formats.data()); + StreamConfiguration cfg(formats); cfg.pixelFormat = DRM_FORMAT_BGR888; cfg.size = { 1920, 1080 };