{"id":16350,"url":"https://patchwork.libcamera.org/api/1.1/patches/16350/?format=json","web_url":"https://patchwork.libcamera.org/patch/16350/","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":"<20220623232210.18742-5-laurent.pinchart@ideasonboard.com>","date":"2022-06-23T23:22:01","name":"[libcamera-devel,04/13] gstreamer: Pass Stream to RequestWrap::addBuffer()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"e1a6f4557edd0b2d1e946fc545115cd20626a729","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16350/mbox/","series":[{"id":3214,"url":"https://patchwork.libcamera.org/api/1.1/series/3214/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3214","date":"2022-06-23T23:21:57","name":"gstreamer: Queue multiple requests","version":1,"mbox":"https://patchwork.libcamera.org/series/3214/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16350/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16350/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D0047BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Jun 2022 23:22:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95F6661FB2;\n\tFri, 24 Jun 2022 01:22:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9EA165639\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jun 2022 01:22:30 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2EFDADD;\n\tFri, 24 Jun 2022 01:22:30 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656026558;\n\tbh=U5uDoigSLXuYOtlGcXh59NjMvxX+p5+F2ubYAla5zD0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=YJ0QplKSXSFSeqDQSb1ehj6UoodtM/xYiudtMi16nb/KrNLXOfD4unsVncJqhLjQ5\n\tM22hGNlp0yreP1+w8Xc5GKbWgvZgS2xu34EfvRONy0foIwsg3/HMqkr6UrlQTDC5AX\n\tK6RNbiFkcwmtpYR8lVV9kyerb2utpJMknfdzMFyPshulakfGFWccgtBvv/6QypdzOe\n\th3mAsi5BKNVQxLpvFaI9pIV5Jb5oq4MjovUASu0/Sn8+wC7CDHCryq2TGl2scosW1Z\n\tK/ogZGQKkceGuj4IzLfuBEtHC0Yrf07M7QIP42GpbWHi/dVGxl6W/An36mL7GDfFdH\n\tSVVwiUORcXRoQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656026550;\n\tbh=U5uDoigSLXuYOtlGcXh59NjMvxX+p5+F2ubYAla5zD0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=e0ubcb2ZSR7TWPTr3PmHd1prA6wZ/hyBReKs/d26vEQHSDlgJPc7UtVKdrWYw/fMO\n\tzhqz5Ceh7mgILnAbry6KqD+8gjBbmyrgEbVDxRqq9leYL00Z5/wIglLFzGrsxMVAgC\n\tk4+QNLUpqCQwvGVJdleaHKJwpSgr+2v3ONk1LgyA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"e0ubcb2Z\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 Jun 2022 02:22:01 +0300","Message-Id":"<20220623232210.18742-5-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20220623232210.18742-1-laurent.pinchart@ideasonboard.com>","References":"<20220623232210.18742-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 04/13] gstreamer: Pass Stream to\n\tRequestWrap::addBuffer()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Nicolas Dufresne <nicolas.dufresne@collabora.com>,\n\tVedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"For symmetry with RequestWrap::removeBuffer(), pass the Stream pointer\nto addBuffer(). This handles streams at the GstPad level instead of the\nGstBuffer level, which allows making the GstLibcameraPool API a bit\ncleaner by removing the gst_libcamera_buffer_get_stream() helper\nfunction.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/gstreamer/gstlibcamerapool.cpp | 7 -------\n src/gstreamer/gstlibcamerapool.h   | 2 --\n src/gstreamer/gstlibcamerasrc.cpp  | 8 ++++----\n 3 files changed, 4 insertions(+), 13 deletions(-)","diff":"diff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp\nindex 118bc6db7067..c7b7fe54cbe1 100644\n--- a/src/gstreamer/gstlibcamerapool.cpp\n+++ b/src/gstreamer/gstlibcamerapool.cpp\n@@ -133,10 +133,3 @@ gst_libcamera_pool_get_stream(GstLibcameraPool *self)\n {\n \treturn self->stream;\n }\n-\n-Stream *\n-gst_libcamera_buffer_get_stream(GstBuffer *buffer)\n-{\n-\tauto *self = (GstLibcameraPool *)buffer->pool;\n-\treturn self->stream;\n-}\ndiff --git a/src/gstreamer/gstlibcamerapool.h b/src/gstreamer/gstlibcamerapool.h\nindex 06b38cb296fc..0ad14be4adf3 100644\n--- a/src/gstreamer/gstlibcamerapool.h\n+++ b/src/gstreamer/gstlibcamerapool.h\n@@ -24,5 +24,3 @@ GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n \t\t\t\t\t libcamera::Stream *stream);\n \n libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n-\n-libcamera::Stream *gst_libcamera_buffer_get_stream(GstBuffer *buffer);\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex dea143961d69..700bee2bf877 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -51,7 +51,7 @@ struct RequestWrap {\n \tRequestWrap(std::unique_ptr<Request> request);\n \t~RequestWrap();\n \n-\tvoid attachBuffer(GstBuffer *buffer);\n+\tvoid attachBuffer(Stream *stream, GstBuffer *buffer);\n \tGstBuffer *detachBuffer(Stream *stream);\n \n \tstd::unique_ptr<Request> request_;\n@@ -71,10 +71,9 @@ RequestWrap::~RequestWrap()\n \t}\n }\n \n-void RequestWrap::attachBuffer(GstBuffer *buffer)\n+void RequestWrap::attachBuffer(Stream *stream, GstBuffer *buffer)\n {\n \tFrameBuffer *fb = gst_libcamera_buffer_get_frame_buffer(buffer);\n-\tStream *stream = gst_libcamera_buffer_get_stream(buffer);\n \n \trequest_->addBuffer(stream, fb);\n \n@@ -275,6 +274,7 @@ gst_libcamera_src_task_run(gpointer user_data)\n \t\tstd::make_unique<RequestWrap>(std::move(request));\n \n \tfor (GstPad *srcpad : state->srcpads_) {\n+\t\tStream *stream = gst_libcamera_pad_get_stream(srcpad);\n \t\tGstLibcameraPool *pool = gst_libcamera_pad_get_pool(srcpad);\n \t\tGstBuffer *buffer;\n \t\tGstFlowReturn ret;\n@@ -290,7 +290,7 @@ gst_libcamera_src_task_run(gpointer user_data)\n \t\t\tbreak;\n \t\t}\n \n-\t\twrap->attachBuffer(buffer);\n+\t\twrap->attachBuffer(stream, buffer);\n \t}\n \n \tif (wrap) {\n","prefixes":["libcamera-devel","04/13"]}