From patchwork Mon Oct 28 02:25:20 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: 2267 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE3AE61515 for ; Mon, 28 Oct 2019 03:25:54 +0100 (CET) X-Halon-ID: 4240a8b0-f92a-11e9-903a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from localhost.localdomain (unknown [93.2.121.143]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 4240a8b0-f92a-11e9-903a-005056917f90; Mon, 28 Oct 2019 03:25:50 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Oct 2019 03:25:20 +0100 Message-Id: <20191028022525.796995-8-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191028022525.796995-1-niklas.soderlund@ragnatech.se> References: <20191028022525.796995-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC 07/12] libcamera: buffer: Add dedicated container for buffer 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: Mon, 28 Oct 2019 02:25:55 -0000 The Buffer object will be split in two, one containing the memory and one containing the information recorded from when the buffer is dequeued. Add a container for the later in preparation for the split. Signed-off-by: Niklas Söderlund --- include/libcamera/buffer.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index 54c757ef7db8b5f6..c626f669040b3c04 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -105,6 +105,40 @@ private: Stream *stream_; }; +class BufferInfo +{ +public: + enum Status { + BufferSuccess, + BufferError, + BufferCancelled, + }; + + struct PlaneInfo { + unsigned int bytesused; + }; + + BufferInfo(Status status, unsigned int sequence, uint64_t timestamp, + const std::vector &planes) + : status_(status), sequence_(sequence), timestamp_(timestamp), + planes_(planes) + { + } + + Status status() const { return status_; } + unsigned int sequence() const { return sequence_; } + unsigned int timestamp() const { return timestamp_; } + + unsigned int planes() const { return planes_.size(); } + const PlaneInfo &plane(unsigned int plane) const { return planes_.at(plane); } + +private: + Status status_; + unsigned int sequence_; + uint64_t timestamp_; + std::vector planes_; +}; + } /* namespace libcamera */ #endif /* __LIBCAMERA_BUFFER_H__ */