From patchwork Mon Sep 7 16:44:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 9512 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 01E98BDB1C for ; Mon, 7 Sep 2020 16:44:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CEE8362BF9; Mon, 7 Sep 2020 18:44:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Nv6Y8ohS"; dkim-atps=neutral Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF2AA60599 for ; Mon, 7 Sep 2020 18:44:56 +0200 (CEST) Received: by mail-wr1-x435.google.com with SMTP id e16so16443997wrm.2 for ; Mon, 07 Sep 2020 09:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t8Hq0wZqqzzJWcIK/J0NH0XRrmlQ5FJTq1ubok6iBi8=; b=Nv6Y8ohS0Otx6TI72kJpd0T6IQu/un9V+i6OagPL6xTYsU84VZucDvmHNt7QFej9Gt TXT5XDt70V4Zy32B2ZYZqJoLmHcwOAx5Qt6WP56RPaD6g/GGC/nKUqieTITC1q5zHZvB IfHT6mvU1LbirwcxHQZjYXi9719cRHWg0IqgCxZbBikcplOZ6C9fUNqVlZAjwyI88eH5 7IsDKhpDTHvlQoSN7mRNvk/rXFffAvZE6sEqbE9yNXCcdxK5t9Cx2gxqZxhRZzlWwKcJ KQHqc7ri26N7ENWGHP/LE3Z9mLme+mTOLy3k7m3R5dvs2T3FICceUmu9eNx4ig3keDZn WLOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t8Hq0wZqqzzJWcIK/J0NH0XRrmlQ5FJTq1ubok6iBi8=; b=Lz1IngCW25pB+Y4yqMX+ii61Zkasa2YuYaHSrtRhpKPYZJ/K6mxOd/P53RR6g7c0QE myAXhW5UiK54Jmodd2tNJIocYDYogv6KJ0ktEh+0uxvAnoDyvndYfB8lxURl9hYL18uO svhJT6EceSVoNX6omOTQX51ppZwD5u8os45N0+M2lqfi3/X8UvfvjFNkAc7Wm7MuXIq5 kJgRkMUpyRuUd/+luNoaYWOelWUXLqp7buiLemj5WFUDZKPlMukVkMNvfMHFtfBcFawD PbArFc9zmKYEnfwjP+gE009r0Lspw5hIVMKtj371/hzsR2QAJZt04qZ01Odr9sebGLAX z1ng== X-Gm-Message-State: AOAM5338tOyA0twgFHPlPbkan2luD2epxivdFQOtc+oZTpS0StiIr4qo 5ZPp3xQRZa8nYO9PbhgV03hM5ZDopsMN5g== X-Google-Smtp-Source: ABdhPJwl3dl10UYpf0EdZkCeawPpoohd6ozh5b4rm75vh+zjfZ4NtcNBLbWswRQI/GyH8t/uDrzq4Q== X-Received: by 2002:adf:f106:: with SMTP id r6mr22783471wro.106.1599497096183; Mon, 07 Sep 2020 09:44:56 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id v3sm27707033wmh.6.2020.09.07.09.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 09:44:55 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Sep 2020 17:44:47 +0100 Message-Id: <20200907164450.13082-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200907164450.13082-1-david.plowman@raspberrypi.com> References: <20200907164450.13082-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 1/4] libcamera: Add SensorOutputSize property 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The SensorOutputSize camera property changes with the selected camera mode, so it must be updated when a new mode is chosen. --- src/libcamera/camera_sensor.cpp | 3 +++ src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 ++ src/libcamera/property_ids.yaml | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index d2679a4..b1c218e 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -249,6 +249,9 @@ int CameraSensor::init() propertyValue = 0; properties_.set(properties::Rotation, propertyValue); + /* The SensorOutputSize is known once the camera mode is chosen. */ + properties_.set(properties::SensorOutputSize, Size(0, 0)); + /* Enumerate, sort and cache media bus codes and sizes. */ formats_ = subdev_->formats(pad_); if (formats_.empty()) { diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index ce43af3..7f151cb 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -646,6 +646,8 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) LOG(RPI, Info) << "Sensor: " << camera->id() << " - Selected mode: " << sensorFormat.toString(); + data->properties_.set(properties::SensorOutputSize, sensorFormat.size); + /* * This format may be reset on start() if the bayer order has changed * because of flips in the sensor. diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml index 74ad019..ed1df19 100644 --- a/src/libcamera/property_ids.yaml +++ b/src/libcamera/property_ids.yaml @@ -640,4 +640,10 @@ controls: \todo Rename this property to ActiveAreas once we will have property categories (i.e. Properties::PixelArray::ActiveAreas) + - SensorOutputSize: + type: Size + description: | + The size, in pixels, of the image being output by the sensor in this + camera mode. + ...