From patchwork Wed Jan 30 11:56:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 448 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 52E5C60DB9 for ; Wed, 30 Jan 2019 12:56:46 +0100 (CET) X-Halon-ID: 1bdfdf0c-2486-11e9-911a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from wyvern.c.hoisthospitality.com (unknown [217.64.245.162]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 1bdfdf0c-2486-11e9-911a-0050569116f7; Wed, 30 Jan 2019 12:56:44 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 30 Jan 2019 12:56:11 +0100 Message-Id: <20190130115615.17362-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190130115615.17362-1-niklas.soderlund@ragnatech.se> References: <20190130115615.17362-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 2/6] libcamera: stream: add initial StreamConfiguration structure X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 11:56:46 -0000 Add an initial StreamConfiguration implementation to hold configuration data for a single stream of a Camera. In its current form not many configuration parameters are supported but it's expected the number of options will grow over time. At this stage the pixel format is represented as an unsigned int to allow for easy mapping to the V4L2 API. This might be subject to change in the future as we finalize how libcamera shall represent pixel formats. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/libcamera/stream.h | 6 ++++++ src/libcamera/stream.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 4f47d85ed6382b36..4b24dd841dd64b64 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -13,6 +13,12 @@ class Stream final { }; +struct StreamConfiguration { + unsigned int width; + unsigned int height; + unsigned int pixelFormat; +}; + } /* namespace libcamera */ #endif /* __LIBCAMERA_STREAM_H__ */ diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index f82b05a2bcfa14e9..4819cd94c1850efb 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -48,4 +48,30 @@ namespace libcamera { * optimal stream for the task. */ +/** + * \struct StreamConfiguration + * \brief Configuration parameters for a stream + * + * The StreamConfiguration structure models all information which can be + * configured for a single video stream. + */ + +/** + * \var StreamConfiguration::width + * \brief Stream width in pixels + */ + +/** + * \var StreamConfiguration::height + * \brief Stream height in pixels + */ + +/** + * \var StreamConfiguration::pixelFormat + * \brief Stream pixel format + * + * This is a little endian four character code representation of the pixel + * format described in V4L2 using the V4L2_PIX_FMT_* definitions. + */ + } /* namespace libcamera */