{"id":726,"url":"https://patchwork.libcamera.org/api/1.1/patches/726/?format=json","web_url":"https://patchwork.libcamera.org/patch/726/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20190312121242.2253-12-jacopo@jmondi.org>","date":"2019-03-12T12:12:39","name":"[libcamera-devel,v2,11/14] libcamera: ipu3: Connect CIO2 and ImgU bufferReady signals","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"af8a80f3984bf114f856ac0b2cdf83f58db0e532","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/726/mbox/","series":[{"id":205,"url":"https://patchwork.libcamera.org/api/1.1/series/205/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=205","date":"2019-03-12T12:12:28","name":"libcamera: ipu3: ImgU support","version":2,"mbox":"https://patchwork.libcamera.org/series/205/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/726/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/726/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D4E8610D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Mar 2019 13:12:26 +0100 (CET)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id BFFBC1C0002;\n\tTue, 12 Mar 2019 12:12:25 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 12 Mar 2019 13:12:39 +0100","Message-Id":"<20190312121242.2253-12-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190312121242.2253-1-jacopo@jmondi.org>","References":"<20190312121242.2253-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 11/14] libcamera: ipu3: Connect CIO2\n\tand ImgU bufferReady signals","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":"Tue, 12 Mar 2019 12:12:26 -0000"},"content":"Connect the CIO2 output bufferRead signal to a slot that simply\nqueue the received buffer to ImgU for processing, and connect the ImgU\nmain output bufferReady signal to the cameraData slot that notifies\nto applications that a new image buffer is available.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 58 +++++++++++++++++++++++++---\n 1 file changed, 53 insertions(+), 5 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 1a7b96d9ada7..4d08383291ea 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -95,7 +95,9 @@ public:\n \t{\n \t}\n \n-\tvoid bufferReady(Buffer *buffer);\n+\tvoid imguOutputBufferReady(Buffer *buffer);\n+\tvoid imguInputBufferReady(Buffer *buffer);\n+\tvoid cio2BufferReady(Buffer *buffer);\n \n \tCIO2Device cio2;\n \tImgUDevice *imgu;\n@@ -402,6 +404,21 @@ int PipelineHandlerIPU3::start(Camera *camera)\n \tIPU3CameraData *data = cameraData(camera);\n \tint ret;\n \n+\t/*\n+\t * Connect video devices' 'bufferReady' signals to their slot to\n+\t * implement the image processing pipeline.\n+\t *\n+\t * Frames produced by the CIO2 unit are shared with the associated\n+\t * ImgU input where they get processed and returned through the ImgU\n+\t * main and secondary outputs.\n+\t */\n+\tdata->cio2.output->bufferReady.connect(data,\n+\t\t\t\t\t&IPU3CameraData::cio2BufferReady);\n+\tdata->imgu->input->bufferReady.connect(data,\n+\t\t\t\t\t&IPU3CameraData::imguInputBufferReady);\n+\tdata->imgu->output->bufferReady.connect(data,\n+\t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n+\n \t/*\n \t * Enqueue all available buffers to the CIO2 unit to start frame\n \t * capture. Start ImgU video devices and queue buffers to the output\n@@ -1001,9 +1018,6 @@ void PipelineHandlerIPU3::registerCameras()\n \t\tstd::shared_ptr<Camera> camera =\n \t\t\tCamera::create(this, cameraName, streams);\n \n-\t\tcio2->output->bufferReady.connect(data.get(),\n-\t\t\t\t\t  &IPU3CameraData::bufferReady);\n-\n \t\tregisterCamera(std::move(camera), std::move(data));\n \n \t\tLOG(IPU3, Info)\n@@ -1015,7 +1029,29 @@ void PipelineHandlerIPU3::registerCameras()\n \t}\n }\n \n-void IPU3CameraData::bufferReady(Buffer *buffer)\n+/* ----------------------------------------------------------------------------\n+ * Buffer Ready slots\n+ */\n+\n+/**\n+ * \\brief ImgU input BufferReady slot\n+ * \\param buffer The completed buffer\n+ *\n+ * Buffer completed from the ImgU input are immediately queued back to the\n+ * CIO2 unit to continue frame capture.\n+ */\n+void IPU3CameraData::imguInputBufferReady(Buffer *buffer)\n+{\n+\tcio2.output->queueBuffer(buffer);\n+}\n+\n+/**\n+ * \\brief ImgU output BufferReady slot\n+ * \\param buffer The completed buffer\n+ *\n+ * Buffer completed from the ImgU output are directed to the applications.\n+ */\n+void IPU3CameraData::imguOutputBufferReady(Buffer *buffer)\n {\n \tRequest *request = queuedRequests_.front();\n \n@@ -1023,6 +1059,18 @@ void IPU3CameraData::bufferReady(Buffer *buffer)\n \tpipe_->completeRequest(camera_, request);\n }\n \n+/**\n+ * \\brief CIO2 BufferReady slot\n+ * \\param buffer The completed buffer\n+ *\n+ * Buffer completed from the CIO2 are immediately queued to the ImgU unit\n+ * for further processing.\n+ */\n+void IPU3CameraData::cio2BufferReady(Buffer *buffer)\n+{\n+\timgu->input->queueBuffer(buffer);\n+}\n+\n REGISTER_PIPELINE_HANDLER(PipelineHandlerIPU3);\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","v2","11/14"]}