From patchwork Sat Jul 4 13:31:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8624 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 4D1A5BD792 for ; Sat, 4 Jul 2020 13:32:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 18A0260E30; Sat, 4 Jul 2020 15:32:02 +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="OpC4FeWc"; 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 1B69F60C50 for ; Sat, 4 Jul 2020 15:32:01 +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 93439296; Sat, 4 Jul 2020 15:31:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593869520; bh=KeI1eX8ffrVBk9a2my1Z7cKMDWikUEP48MeZZsKnNjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OpC4FeWcoop26LAsYOSelg8EjDBucyXzfDNmV6VaGIkYFOpYmcHw8oQkLJnwe2zbr T1bIlnzwWSu2B0WhZKr0TJ5dXkg0h2WDJ5v+GFEZSaP5wbgDEmxz6DRPWtUyEHkIN7 UwupNt6rw5JutupltkRS9enRfCJTXmojFILLT71o= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jul 2020 22:31:21 +0900 Message-Id: <20200704133140.1738660-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200704133140.1738660-1-paul.elder@ideasonboard.com> References: <20200704133140.1738660-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 03/22] 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 --- 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