From patchwork Mon Oct 28 02:25:19 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: 2265 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AA3F61509 for ; Mon, 28 Oct 2019 03:25:53 +0100 (CET) X-Halon-ID: 41b3fa67-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 41b3fa67-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:19 +0100 Message-Id: <20191028022525.796995-7-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 06/12] libcamera: stream: Add prototypes for new interface 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:53 -0000 The buffer allocation rework will remove most of the methods in the Stream class. The methods who deals with buffers will be virtual and implemented in a subclass. This change adds the prototypes for the new interface with an empty default implementation. Once the new buffer allocation work is completed the two added prototypes here will be turned into pure virtual functions preventing the base Stream class from being instantiated. Signed-off-by: Niklas Söderlund --- include/libcamera/stream.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 2e619cdf0e89bbc7..dac4831cfa1a9b1d 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -73,6 +73,7 @@ class Stream { public: Stream(); + virtual ~Stream(){}; std::unique_ptr createBuffer(unsigned int index); std::unique_ptr createBuffer(const std::array &fds); @@ -85,6 +86,9 @@ public: protected: friend class Camera; + virtual int allocateBuffers(std::vector *buffers) { return -EINVAL; } + virtual int importBuffers(bool enable) { return -EINVAL; } + int mapBuffer(const Buffer *buffer); void unmapBuffer(const Buffer *buffer);