From patchwork Wed May 4 13:21:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15777 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 22615C326D for ; Wed, 4 May 2022 13:22:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 558DC6565A; Wed, 4 May 2022 15:22:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1651670526; bh=JN1RXQayuzopNsDmpw3NQuT6eRGlbIl310dd8nGKdIk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=P1DN7eEu0DOl1vwYRWAtV/y2/v20CZ5TG2F5u7NUXjtUN4gTg+0vT+z4oET2OciPb mcc3LoXOVcnCXft9bqocEcR8Vgak5esxn0OD8KWIVnxRqfavQLlWly7zKV6Vkkxgcl QNj3lOHcr5M65iLQ/bW5YYi6SA4hsWntS0E8h8sNfwhzIEWEqup3Xxnr9Y900cnbhI YQIFawHwxJ8W0uewY2chjtGIjSjP3eCNR0+yzFI9AadF2OqBSiJhsdZYUDkYvWbzK4 YDoGxfGDaZwl17hcz2Xa0fSCmnvkYFnQ1Xm2QTOR7H5sMYPSh2bQLxuOV2PboJOilt Z5yUwcC7eqpFA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 21C0265642 for ; Wed, 4 May 2022 15:22:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gXzw5uTm"; 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 B47344A8 for ; Wed, 4 May 2022 15:22:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1651670520; bh=JN1RXQayuzopNsDmpw3NQuT6eRGlbIl310dd8nGKdIk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gXzw5uTmzP1DnNlHc7J7DNQ15z1t1bsCaMP6bDoZ780oOH2gVVLh+NiGdoSKlFR32 CUdTiMot1g56sjqZ3mOXX21lOWN1WN2q7O8BsqIhKfNErPpEXtUOAUJn7AOk/BxLXo d/3yYB09CIcAKXe5SDv1Pwt0ApGtB9t8OR/j7zV4= To: libcamera-devel@lists.libcamera.org Date: Wed, 4 May 2022 16:21:53 +0300 Message-Id: <20220504132154.9681-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220504132154.9681-1-laurent.pinchart@ideasonboard.com> References: <20220504132154.9681-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 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 --- 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 19deb9447c96..e7fda239d6b5 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; @@ -534,6 +535,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; @@ -935,7 +937,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)