From patchwork Wed Jul 12 10:55:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18812 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 9B05CBEFBE for ; Wed, 12 Jul 2023 10:55:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 611D9628C5; Wed, 12 Jul 2023 12:55:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1689159319; bh=GbCNopN9pW8LtUqh1yGFB6TheYb7T5Tuyy3vafgL4PE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=OMsNXyzwZBP4h71izVpUQmE5u3V9O8dzPkYAP0N/7yZ+QQwCrk+PksScP1UvEBgR1 UXp4sYMCfRDP68oWpzzC/ysLSximpq9MwcSOgshOHyXCTl5WjK4MqRY0Ub6Mljiluo 14FFLAnU4FqV01Y8Xsp0ex2KlmLTJTrDHIW8bey4sZmf2CFoYDbCkqLcCVK9070mzQ dw42SnmA7kU7A5XOLaqJ01sW8O7K85mf5rXf+Pibf3nLQ5+P0JLU5xGd5RhmAPfk1j jVZZUOQvG+Lzu8AQN0inl77LyyS5u+Mt9v111zP5o1CJ+IC3K9NSiwg81hNft9t8Gu 0NkvXQNg7g8bA== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 120C8628BC for ; Wed, 12 Jul 2023 12:55:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ALfh0iSZ"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbf1b82dc7so69572365e9.2 for ; Wed, 12 Jul 2023 03:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1689159316; x=1691751316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3I3mQQ7p5w35xVgOx/HdcUcYkY49S25NpmzKkcobU9k=; b=ALfh0iSZU/WGHF7gvWJXhIsMGlKaFH8rXKZowmMPLWEk+G2Vef+Pjr2cmCr+0vQf8d so64oRQOoi2Q5LNt/jxLUaoW3zBsXRqyeGD2sw/3a67D4m04y/qsaBb54+W5vf6BiWSR fh0MSqTnAxvFFupQzE9eZdTbkV7TdMMqNSjpeSsLI0IXU/PP2ViS1CB1elvoPwR5/azn 5iq9yKY/FXw/PP5csH3BWqDaOugHM7/pN+QCBgUIXotZQvLdTE4IL5InWP52BQHigbaY YwmhJH8yTkXLx1UpejTbU0pax2yovhF0XZVenVaIfVx5sY5btSb7+Sy1+sa32XcVuBBA 0zEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689159316; x=1691751316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3I3mQQ7p5w35xVgOx/HdcUcYkY49S25NpmzKkcobU9k=; b=Ms7psF1D5RIciopSJcAXUVwdWUZael6aKiecb+qtMy9BzfhJNPBGW4PkAE1Wk0yDKS ezPR8wg7V51tIumSW+Xo3eFvIFdiBC4CgKUcxyCqO4UQCvQG6dpPLk/g7Un7TZSNkXNv M4zOZUvyjnC5w6BWWruY+k0tPLuRU0N9dN+khZ4eBBa8FIpzl0edFYb2LmDGYeWr25Y9 iJgOn4410QVtlUYr4STxS9nKBm5Irne/0cu21+uxbzebEO1fLoikZxMecYkgWV+1Brp7 vtYd0mC1olIsbSaz/ewLGLnoFV2KyxMbfmv9Io6GJRri2ChFJ+Q8Jjeow3aTcFDIP+qN FbIg== X-Gm-Message-State: ABy/qLYjZGKd4FcKJ/1P5gSGkrqyf1J0DolHyAuG/Vl4KXm10UdSiGaH g1facTCQAMjtLJo27TqNT/xV3qeCu6qQPU+UHWIaYw== X-Google-Smtp-Source: APBJJlFj5u21CRGoEiRJUGOAlkVefo2HF4ugzBK/yK/7ph6wQ5QShI9zDKaZ3Xx5o6urPwRTVivGHQ== X-Received: by 2002:a1c:750a:0:b0:3fb:c462:1833 with SMTP id o10-20020a1c750a000000b003fbc4621833mr17406998wmc.30.1689159316355; Wed, 12 Jul 2023 03:55:16 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id h14-20020a05600c260e00b003fc05b89e5bsm4729236wma.34.2023.07.12.03.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 03:55:16 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 12 Jul 2023 11:55:08 +0100 Message-Id: <20230712105510.14658-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230712105510.14658-1-naush@raspberrypi.com> References: <20230712105510.14658-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 1/3] libcamera: rpi: pipeline_base: Remove populateSensorFormats() 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-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Jacopo Mondi populateSensorFormats() is a static helper that is called from a single place and performs a simple loop over the sensor camera formats. Remove it and in-line it in the caller to remove one static helper from the pipeline_base.cpp file. Signed-off-by: Jacopo Mondi Reviewed-by: Naushir Patuck Reviewed-by: Kieran Bingham --- .../pipeline/rpi/common/pipeline_base.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 179a5b81a516..fb3756a47590 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -66,16 +66,6 @@ PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code, return pix; } -SensorFormats populateSensorFormats(std::unique_ptr &sensor) -{ - SensorFormats formats; - - for (auto const mbusCode : sensor->mbusCodes()) - formats.emplace(mbusCode, sensor->sizes(mbusCode)); - - return formats; -} - bool isMonoSensor(std::unique_ptr &sensor) { unsigned int mbusCode = sensor->mbusCodes()[0]; @@ -804,7 +794,10 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr &camera if (data->sensor_->init()) return -EINVAL; - data->sensorFormats_ = populateSensorFormats(data->sensor_); + /* Populate the map of sensor supported formats and sizes. */ + for (auto const mbusCode : data->sensor_->mbusCodes()) + data->sensorFormats_.emplace(mbusCode, + data->sensor_->sizes(mbusCode)); /* * Enumerate all the Video Mux/Bridge devices across the sensor -> Fr