From patchwork Wed Apr 3 15:07:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 910 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BEE3D6110D for ; Wed, 3 Apr 2019 17:06:58 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 54BE8FF806; Wed, 3 Apr 2019 15:06:58 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Apr 2019 17:07:32 +0200 Message-Id: <20190403150735.27580-6-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190403150735.27580-1-jacopo@jmondi.org> References: <20190403150735.27580-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 5/8] libcamera: request: Add streams() method 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, 03 Apr 2019 15:06:59 -0000 Add a method to retrieve the list of streams contained in a requests. This is useful for pipeline handler willing to cycle on all the streams a request contains at queueRequest() time. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- include/libcamera/request.h | 3 +++ src/libcamera/request.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 0dbd425115e8..5ac4d20d1d9f 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -7,6 +7,7 @@ #ifndef __LIBCAMERA_REQUEST_H__ #define __LIBCAMERA_REQUEST_H__ +#include #include #include @@ -35,6 +36,8 @@ public: int setBuffers(const std::map &streamMap); Buffer *findBuffer(Stream *stream) const; + const std::list streams() const; + Status status() const { return status_; } private: diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index e0e77e972411..3a7841fb2bb3 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -93,6 +93,21 @@ Buffer *Request::findBuffer(Stream *stream) const return it->second; } +/** + * \brief Retrieve the set of streams contained in the request + * + * \return The set of streams contained in the request + */ +const std::list Request::streams() const +{ + std::list streams = {}; + + for (auto const &it : bufferMap_) + streams.push_front(it.first); + + return streams; +} + /** * \fn Request::status() * \brief Retrieve the request completion status