From patchwork Wed Mar 20 16:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 762 Return-Path: Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 029B3600FC for ; Wed, 20 Mar 2019 17:30:38 +0100 (CET) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 94A59200008; Wed, 20 Mar 2019 16:30:37 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 20 Mar 2019 17:30:40 +0100 Message-Id: <20190320163055.22056-17-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190320163055.22056-1-jacopo@jmondi.org> References: <20190320163055.22056-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 16/31] libcamera: request: Store the streams in the request 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: Wed, 20 Mar 2019 16:30:38 -0000 Store the streams which the request applies to and provide an accessor method to return them in a set. Signed-off-by: Jacopo Mondi --- include/libcamera/request.h | 2 ++ src/libcamera/request.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 0dbd425115e8..1bf90de2c6f9 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -34,6 +34,7 @@ public: int setBuffers(const std::map &streamMap); Buffer *findBuffer(Stream *stream) const; + const std::set &streams() const { return streams_; } Status status() const { return status_; } @@ -49,6 +50,7 @@ private: Camera *camera_; std::map bufferMap_; std::unordered_set pending_; + std::set streams_; Status status_; }; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index e0e77e972411..22c516208ede 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -51,6 +51,13 @@ Request::Request(Camera *camera) { } +/** + * \fn Request::streams() + * \brief Retrieve the set of streams contained in the request + * + * \return The set of streams contained in the request + */ + /** * \brief Set the streams to capture with associated buffers * \param[in] streamMap The map of streams to buffers @@ -65,6 +72,10 @@ int Request::setBuffers(const std::map &streamMap) } bufferMap_ = streamMap; + + for (const auto &map : streamMap) + streams_.insert(map.first); + return 0; } @@ -77,6 +88,11 @@ int Request::setBuffers(const std::map &streamMap) * map. */ +/** + * \var Request::streams_ + * \brief Set of streams in this request + */ + /** * \brief Return the buffer associated with a stream * \param[in] stream The stream the buffer is associated to