From patchwork Tue Nov 26 23:36:06 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: 2364 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 7421C61C95 for ; Wed, 27 Nov 2019 00:39:36 +0100 (CET) X-Halon-ID: 0072a09f-10a6-11ea-a0b9-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac5865.dip0.t-ipconnect.de [84.172.88.101]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 0072a09f-10a6-11ea-a0b9-005056917f90; Wed, 27 Nov 2019 00:39:34 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 27 Nov 2019 00:36:06 +0100 Message-Id: <20191126233620.1695316-17-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191126233620.1695316-1-niklas.soderlund@ragnatech.se> References: <20191126233620.1695316-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 16/30] libcamera: buffer: Buffer remove metadata information 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: , X-List-Received-Date: Tue, 26 Nov 2019 23:39:37 -0000 All metadata information is now stored in the associated BufferInfo object, remove all metadata information from the Buffer object. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- include/libcamera/buffer.h | 14 ---------- src/libcamera/buffer.cpp | 53 +------------------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index 2e5376fb8b53a4c5..acc876eec7d93873 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -105,12 +105,6 @@ private: class Buffer final { public: - enum Status { - BufferSuccess, - BufferError, - BufferCancelled, - }; - Buffer(unsigned int index = -1, const Buffer *metadata = nullptr); Buffer(const Buffer &) = delete; Buffer &operator=(const Buffer &) = delete; @@ -119,12 +113,8 @@ public: const std::array &dmabufs() const { return dmabuf_; } BufferMemory *mem() { return mem_; } - unsigned int bytesused() const { return bytesused_; } - uint64_t timestamp() const { return timestamp_; } - unsigned int sequence() const { return sequence_; } const BufferInfo &info() const { return info_; }; - Status status() const { return status_; } Request *request() const { return request_; } Stream *stream() const { return stream_; } @@ -140,12 +130,8 @@ private: std::array dmabuf_; BufferMemory *mem_; - unsigned int bytesused_; - uint64_t timestamp_; - unsigned int sequence_; BufferInfo info_; - Status status_; Request *request_; Stream *stream_; }; diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp index d5a4815a0bb8c528..ab28e0d76b8c40f7 100644 --- a/src/libcamera/buffer.cpp +++ b/src/libcamera/buffer.cpp @@ -349,20 +349,6 @@ void BufferPool::destroyBuffers() * deleted automatically after the request complete handler returns. */ -/** - * \enum Buffer::Status - * Buffer completion status - * \var Buffer::BufferSuccess - * The buffer has completed with success and contains valid data. All its other - * metadata (such as bytesused(), timestamp() or sequence() number) are valid. - * \var Buffer::BufferError - * The buffer has completed with an error and doesn't contain valid data. Its - * other metadata are valid. - * \var Buffer::BufferCancelled - * The buffer has been cancelled due to capture stop. Its other metadata are - * invalid and shall not be used. - */ - /** * \brief Construct a buffer not associated with any stream * @@ -371,8 +357,7 @@ void BufferPool::destroyBuffers() * for a stream with Stream::createBuffer(). */ Buffer::Buffer(unsigned int index, const Buffer *metadata) - : index_(index), dmabuf_({ -1, -1, -1 }), - status_(Buffer::BufferSuccess), request_(nullptr), + : index_(index), dmabuf_({ -1, -1, -1 }), request_(nullptr), stream_(nullptr) { unsigned int sequence; @@ -420,32 +405,6 @@ Buffer::Buffer(unsigned int index, const Buffer *metadata) * \return The BufferMemory this buffer is associated with */ -/** - * \fn Buffer::bytesused() - * \brief Retrieve the number of bytes occupied by the data in the buffer - * \return Number of bytes occupied in the buffer - */ - -/** - * \fn Buffer::timestamp() - * \brief Retrieve the time when the buffer was processed - * - * The timestamp is expressed as a number of nanoseconds since the epoch. - * - * \return Timestamp when the buffer was processed - */ - -/** - * \fn Buffer::sequence() - * \brief Retrieve the buffer sequence number - * - * The sequence number is a monotonically increasing number assigned to the - * buffer processed by the stream. Gaps in the sequence numbers indicate - * dropped frames. - * - * \return Sequence number of the buffer - */ - /** * \fn Buffer::info() * \brief Retrieve the buffer metadata information @@ -456,16 +415,6 @@ Buffer::Buffer(unsigned int index, const Buffer *metadata) * \return Metadata of the buffer */ -/** - * \fn Buffer::status() - * \brief Retrieve the buffer status - * - * The buffer status reports whether the buffer has completed successfully - * (BufferSuccess) or if an error occurred (BufferError). - * - * \return The buffer status - */ - /** * \fn Buffer::request() * \brief Retrieve the request this buffer belongs to