From patchwork Tue Jan 29 13:53:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 442 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 60E2260DB9 for ; Tue, 29 Jan 2019 14:54:02 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ECA8E2F5; Tue, 29 Jan 2019 14:54:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1548770042; bh=tWyZl+2uCZsk1WDXmI44TZGPn6aXbCqwQIT7f9XvXOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tL5bEWQybWSAX2mRAi45p6hPl7CGOEo7tvB2OGG8E27hO1l+kDf0JG/4QV1DmJetw iJc7mdIJeB+jEfgQlSIMUoaVSS8OeGksJrt0S/4M1Dh9bfyT17E+85ZCbypZFc/uO6 AItP70Jr3w2QSuFWat6akAzuxXhaT0gz5ngH1yFM= From: Kieran Bingham To: LibCamera Devel Date: Tue, 29 Jan 2019 13:53:55 +0000 Message-Id: <20190129135357.32339-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190129135357.32339-1-kieran.bingham@ideasonboard.com> References: <20190129135357.32339-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/4] 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: Tue, 29 Jan 2019 13:54:02 -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 6dfebfc6bb28..5c580b540a67 100644 --- a/src/libcamera/buffer.cpp +++ b/src/libcamera/buffer.cpp @@ -64,6 +64,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) @@ -75,6 +106,9 @@ BufferPool::~BufferPool() free(); } +/** + * \brief Allocate buffers in a pool + */ int BufferPool::allocate(unsigned int count) { for (unsigned int i = 0; i < count; ++i) { @@ -91,6 +125,9 @@ int BufferPool::allocate(unsigned int count) return 0; } +/** + * \brief Release all buffers from pool. + */ void BufferPool::free() { for (Buffer *buffer : buffers_) @@ -99,4 +136,9 @@ void BufferPool::free() buffers_.clear(); } +/** + * \fn BufferPool::count() + * \brief Get the number of Buffers contained within this pool + */ + } /* namespace libcamera */