From patchwork Tue Mar 17 03:52:34 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: 3134 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CECEE6297B for ; Tue, 17 Mar 2020 04:53:37 +0100 (CET) X-Halon-ID: dab5ef3f-6802-11ea-aa6d-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id dab5ef3f-6802-11ea-aa6d-005056917f90; Tue, 17 Mar 2020 04:53:25 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 17 Mar 2020 04:52:34 +0100 Message-Id: <20200317035239.2697679-4-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200317035239.2697679-1-niklas.soderlund@ragnatech.se> References: <20200317035239.2697679-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/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: Tue, 17 Mar 2020 03:53:38 -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 8792dfe48ed8db31..72924bf2f55d0021 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -173,17 +173,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 };