From patchwork Sun Feb 3 10:55:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 484 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EB62960DBB for ; Sun, 3 Feb 2019 11:55:21 +0100 (CET) Received: from localhost.localdomain (218.182-78-194.adsl-static.isp.belgacom.be [194.78.182.218]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 88322D4B; Sun, 3 Feb 2019 11:55:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1549191321; bh=35bii0CJhMK4PSa+eowHSiDQzo7TB3r3oh9XcibmUC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LT6D/iK4lhWmHL6KAeEKr8rzrSS71b6syyZ3A4hDLJrlWcehMFBU/BLhhT+a7v5Tu sMmbwMZF3is+ZgDl2vE8WAmM/dqjiU4U/uLdW5R6DegGmDDO4sUAzyRKgqihjlCTUS puNTrZS9Snn0uuhPPEWybNFJa/09VW7E77WqpPkU= From: Kieran Bingham To: LibCamera Devel Date: Sun, 3 Feb 2019 11:55:15 +0100 Message-Id: <20190203105517.5355-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190203105517.5355-1-kieran.bingham@ideasonboard.com> References: <20190203105517.5355-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/5] libcamera: buffer: Document the BufferPool 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: Sun, 03 Feb 2019 10:55:22 -0000 Add Doxygen documentation for the existing code in the BufferPool class. Signed-off-by: Kieran Bingham --- src/libcamera/buffer.cpp | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp index c86847daf193..5abc2a68e978 100644 --- a/src/libcamera/buffer.cpp +++ b/src/libcamera/buffer.cpp @@ -73,6 +73,37 @@ int Buffer::setDmabuf(int fd) /** * \class BufferPool * \brief A pool of buffers + * + * The BufferPool class groups together a collection of Buffers for passing + * between devices. The buffers must be exported by a device before they can be + * imported into another device for further use. + */ + +/** + * \enum BufferPool::Memory + * \brief Identify the memory type used in the BufferPool + */ + +/** + * \var BufferPool::Internal + * \brief The memory for the Buffers in this pool is allocated internally by the + * device associated with the pool + */ + +/** + * \var BufferPool::External + * \brief The memory for the Buffers in this pool is allocated externally by + * another device and can be imported for use by other devices. + * + * The buffers in the pool have been exported to make them available for sharing + * with other devices, and can be managed using their own file descriptors. + */ + +/** + * \brief Construct a buffer pool. The \a memory argument declares the intent of + * the pool to be either internal or external to a device. + * + * \sa BufferPool::Memory */ BufferPool::BufferPool(BufferPool::Memory memory) : memory_(memory) @@ -84,6 +115,9 @@ BufferPool::~BufferPool() free(); } +/** + * \brief Allocate buffers in a pool + */ int BufferPool::allocate(unsigned int count) { for (unsigned int i = 0; i < count; ++i) { @@ -100,6 +134,9 @@ int BufferPool::allocate(unsigned int count) return 0; } +/** + * \brief Release all buffers from pool. + */ void BufferPool::free() { for (Buffer *buffer : buffers_) @@ -108,4 +145,9 @@ void BufferPool::free() buffers_.clear(); } +/** + * \fn BufferPool::count() + * \brief Get the number of Buffers contained within this pool + */ + } /* namespace libcamera */