{"id":999,"url":"https://patchwork.libcamera.org/api/patches/999/?format=json","web_url":"https://patchwork.libcamera.org/patch/999/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190415231859.9747-7-jacopo@jmondi.org>","date":"2019-04-15T23:18:58","name":"[libcamera-devel,v5,6/7] libcamera: request: Expose the Stream to Buffers map","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"a1b7e98e3271f042110d995bd52912ec89ee4c36","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/999/mbox/","series":[{"id":251,"url":"https://patchwork.libcamera.org/api/series/251/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=251","date":"2019-04-15T23:18:52","name":"libcamera: Framework changes to prepare for multiple streams support","version":5,"mbox":"https://patchwork.libcamera.org/series/251/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/999/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/999/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EF6FB60DC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 01:18:22 +0200 (CEST)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 2A7941BF203;\n\tMon, 15 Apr 2019 23:18:21 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 16 Apr 2019 01:18:58 +0200","Message-Id":"<20190415231859.9747-7-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190415231859.9747-1-jacopo@jmondi.org>","References":"<20190415231859.9747-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 6/7] libcamera: request: Expose the\n\tStream to Buffers map","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Mon, 15 Apr 2019 23:18:23 -0000"},"content":"Add to the Request class a method to access the map to Stream to Buffer.\n\nPrepare the IPU3 pipeline handler to support multiple streams by\nretrieving the buffers to queue from the map exposed by this change, to\nbetter show the purpose of the patch.\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/request.h          |  1 +\n src/libcamera/pipeline/ipu3/ipu3.cpp | 19 ++++++++-----------\n src/libcamera/request.cpp            | 10 ++++++++++\n 3 files changed, 19 insertions(+), 11 deletions(-)","diff":"diff --git a/include/libcamera/request.h b/include/libcamera/request.h\nindex 6f97aa177ae0..e9687f7e14d3 100644\n--- a/include/libcamera/request.h\n+++ b/include/libcamera/request.h\n@@ -32,6 +32,7 @@ public:\n \tRequest(const Request &) = delete;\n \tRequest &operator=(const Request &) = delete;\n \n+\tconst std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }\n \tint setBuffers(const std::map<Stream *, Buffer *> &streamMap);\n \tBuffer *findBuffer(Stream *stream) const;\n \ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex f96e8763bce9..7d865fa329ea 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -409,19 +409,16 @@ int PipelineHandlerIPU3::queueRequest(Camera *camera, Request *request)\n {\n \tIPU3CameraData *data = cameraData(camera);\n \tV4L2Device *output = data->imgu_->output_.dev;\n-\tStream *stream = &data->stream_;\n \n-\t/* Queue a buffer to the ImgU output for capture. */\n-\tBuffer *buffer = request->findBuffer(stream);\n-\tif (!buffer) {\n-\t\tLOG(IPU3, Error)\n-\t\t\t<< \"Attempt to queue request with invalid stream\";\n-\t\treturn -ENOENT;\n-\t}\n+\t/* Queue buffers to the ImgU output for capture. */\n+\tfor (auto &it : request->buffers()) {\n+\t\tBuffer *buffer = it.second;\n \n-\tint ret = output->queueBuffer(buffer);\n-\tif (ret < 0)\n-\t\treturn ret;\n+\t\tint ret = output->queueBuffer(buffer);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\n+\t}\n \n \tPipelineHandler::queueRequest(camera, request);\n \ndiff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex 33055c5ac533..7fa034e6c747 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -51,6 +51,16 @@ Request::Request(Camera *camera)\n {\n }\n \n+/**\n+ * \\fn Request::buffers()\n+ * \\brief Retrieve the request's streams to buffer map\n+ *\n+ * Return a reference to the map that associates each Stream part of the\n+ * request to the Buffer the Stream output should be directed to.\n+ *\n+ * \\return The map of Stream to Buffer\n+ */\n+\n /**\n  * \\brief Set the streams to capture with associated buffers\n  * \\param[in] streamMap The map of streams to buffers\n","prefixes":["libcamera-devel","v5","6/7"]}