From patchwork Thu Jul 9 13:28:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8718 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 8E015BD792 for ; Thu, 9 Jul 2020 13:28:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5BB7661224; Thu, 9 Jul 2020 15:28:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EzCwjNQf"; dkim-atps=neutral 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 466DF6121E for ; Thu, 9 Jul 2020 15:28:56 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5A34E56E; Thu, 9 Jul 2020 15:28:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594301335; bh=Sw0aLZ4tekKrRXFGfRP186lv/HOJyhfIHNHMLQbRQAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzCwjNQfTOz6qBYBZS6FQDhkXoPcoAIg502+aVL3OtSZggSR5sCM8Xv32QXqNATNr odtsToGuVqbJIT/e7K2B+Hm7Bhj5xWEGtKmpDOaI6p6jiPxK6c0DGAyMQwpPWW3LDP aG9W0V/AUf04jnIdvsuUwZLlDM5twSfuKrtSb8r0= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Jul 2020 22:28:15 +0900 Message-Id: <20200709132835.112593-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200709132835.112593-1-paul.elder@ideasonboard.com> References: <20200709132835.112593-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 03/23] libcamera: StreamConfiguration: Add frameSize field 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" In addition to the stride field, we want the pipeline handler to be able to declare the frame size for the configuration. Add a frameSize field to StreamConfiguration for this purpose. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- No change in v5 No change in v4 New in v3 --- include/libcamera/stream.h | 1 + src/libcamera/stream.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 1a68bd2..f502b35 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -43,6 +43,7 @@ struct StreamConfiguration { PixelFormat pixelFormat; Size size; unsigned int stride; + unsigned int frameSize; unsigned int bufferCount; diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 6df5882..6d6e279 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -279,7 +279,8 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const * handlers provide StreamFormats. */ StreamConfiguration::StreamConfiguration() - : pixelFormat(0), stride(0), bufferCount(0), stream_(nullptr) + : pixelFormat(0), stride(0), frameSize(0), bufferCount(0), + stream_(nullptr) { } @@ -287,8 +288,8 @@ StreamConfiguration::StreamConfiguration() * \brief Construct a configuration with stream formats */ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) - : pixelFormat(0), stride(0), bufferCount(0), stream_(nullptr), - formats_(formats) + : pixelFormat(0), stride(0), frameSize(0), bufferCount(0), + stream_(nullptr), formats_(formats) { } @@ -315,6 +316,16 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) * the camera is configured. */ +/** + * \var StreamConfiguration::frameSize + * \brief Frame size for the stream, in bytes + * + * The frameSize value reports the number of bytes necessary to contain one + * frame of an image buffer for this stream. The value is valid after + * successfully validating the configuration with a call to + * CameraConfiguration::validate(). + */ + /** * \var StreamConfiguration::bufferCount * \brief Requested number of buffers to allocate for the stream