From patchwork Sun Jun 12 15:23:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16202 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 81A27C3277 for ; Sun, 12 Jun 2022 15:23:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7EBD065646; Sun, 12 Jun 2022 17:23:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655047409; bh=r+X7VYZUsM/hMS4pjICoikt95yUzv6PyR6QOHrIcKIg=; 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=XNCzIkgGcqCQNVPLMqXTtjBZK8mwVZRG6zZ97Fb/xK6c2i9g/1w5TPXRXGDEsi7o4 8sdTp7Ww0otOz0yd14R7HCIFhlnfOHjM+8JozmMgO7Fa5ORZuzvgV+4/pCEyFsfYBZ GxVf4TlOFLQrtGJGKUARnvpC/o2mgEVVQ3u36bgZwGQfeNl1xtK26yQQAFeD03eX1i Fl5WDayblMk4N2NEaxDzIgTcx/dFUSH9GMwjNxWfeNYsc5xJQIT/B+eGXLcUa39pZ4 a7O9GFW8yTnd3h9AiJAlvvWYBDXC0enl5NdJ9ueUWSA2mLk2BuuuEI0qgIj1mTFh/8 MOper4bAtin2w== 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 3936165633 for ; Sun, 12 Jun 2022 17:23:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PF5aME+0"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B615EDFC; Sun, 12 Jun 2022 17:23:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655047406; bh=r+X7VYZUsM/hMS4pjICoikt95yUzv6PyR6QOHrIcKIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PF5aME+00CGVyfyvLuY2vKvwBnmUrPYdtEUKAyinN8Xhw3F5ipmoNe670LA/XnDQs NYiAGovZkLXQDFV2xgepCNFViEHRQaIvTEbB104wyGg1xgWTN475QUsCJqQgafKDmp H3BiEogjOco2W0QH7dWtLjYojMti0qFrFGeivLos= To: libcamera-devel@lists.libcamera.org Date: Sun, 12 Jun 2022 18:23:10 +0300 Message-Id: <20220612152311.8408-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220612152311.8408-1-laurent.pinchart@ideasonboard.com> References: <20220612152311.8408-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: simple: Store sensor resolution in configuration 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Cc: Dorota Czaplejewicz , Benjamin Schaaf Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When enumerating the supported configurations, store the corresponding sensor resolution in the SimpleCameraData::Configuration structure and use it when configuring the camera, instead of hardcoding the sensor full resolution. This prepares for support of downscaling in the camera sensor. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 3c90bdec60e0..8c48162d7ff0 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -225,6 +225,7 @@ public: struct Configuration { uint32_t code; + Size sensorSize; PixelFormat captureFormat; Size captureSize; std::vector outputFormats; @@ -542,6 +543,7 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size) Configuration config; config.code = code; + config.sensorSize = size; config.captureFormat = pixelFormat; config.captureSize = format.size; @@ -943,7 +945,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) const SimpleCameraData::Configuration *pipeConfig = config->pipeConfig(); V4L2SubdeviceFormat format{}; format.mbus_code = pipeConfig->code; - format.size = data->sensor_->resolution(); + format.size = pipeConfig->sensorSize; ret = data->setupFormats(&format, V4L2Subdevice::ActiveFormat); if (ret < 0)