[{"id":23622,"web_url":"https://patchwork.libcamera.org/comment/23622/","msgid":"<c0cecf11d733fe930326b5234863e88f9b5b9467.camel@collabora.com>","date":"2022-06-27T20:48:56","subject":"Re: [libcamera-devel] [PATCH 04/13] gstreamer: Pass Stream to\n\tRequestWrap::addBuffer()","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le vendredi 24 juin 2022 à 02:22 +0300, Laurent Pinchart a écrit :\n> For symmetry with RequestWrap::removeBuffer(), pass the Stream pointer\n> to addBuffer(). This handles streams at the GstPad level instead of the\n> GstBuffer level, which allows making the GstLibcameraPool API a bit\n> cleaner by removing the gst_libcamera_buffer_get_stream() helper\n> function.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nAgreed, thanks.\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\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(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp\n> index 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> -}\n> diff --git a/src/gstreamer/gstlibcamerapool.h b/src/gstreamer/gstlibcamerapool.h\n> index 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);\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 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) {","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 5E5FEBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jun 2022 20:49:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 040F665635;\n\tMon, 27 Jun 2022 22:49:07 +0200 (CEST)","from madras.collabora.co.uk (madras.collabora.co.uk\n\t[46.235.227.172])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E5EA96059B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jun 2022 22:49:05 +0200 (CEST)","from nicolas-tpx395.localdomain (192-222-136-102.qc.cable.ebox.net\n\t[192.222.136.102])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby madras.collabora.co.uk (Postfix) with ESMTPSA id 276E766015C8;\n\tMon, 27 Jun 2022 21:49:05 +0100 (BST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656362947;\n\tbh=dukXQTKq4bIHCeBbXRthcZhg0TvKOgI4cNim/BY5wUM=;\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=qiGnTAf5toGBnmH0lotVYCYYJKu9Q/wI6NWd6lxN/xJxOD5Pr9WLgCWPmbWtjcXtZ\n\tULHcqfZw4V47aW1LPQj/d6+czFNRfmPdkVfWBVUla8AO5ygU80ul99Snpeld70IAOE\n\t40oKuEp27KPI0z6t46AYgCn2M3lBRSIZQIGIoOS+HqlulCMTYfJwRyaJBaRkbP46gI\n\tTMNeka3tle8VABqFsV7kp3YourYuOBjRQdrlQb6xmI8D5PsDctQizcQXFOt8G+OaeL\n\t0MEJEnRRFrAymmO9HeXh/mSNzDmLpwLsoyVfoOzNQ1EZM7hO1DjbrtaCB7AlN8/wal\n\tRjhh//UwW8taw==","v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1656362945;\n\tbh=dukXQTKq4bIHCeBbXRthcZhg0TvKOgI4cNim/BY5wUM=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=PgAeNCoZWw9FQkq4XxzsfynrdUQFxgaDTIYDneI/fSUlkrNLeEq3CGyhtZAMAYUj5\n\tE4G+i4TT7dcd1zvKthYJJER62MSNMtMNe6Y573zanPCxCPARrDbWwBNGN7+ldKUVrw\n\tdgYMJp94OTSUNAu8i9yOVPqe0tmO8ppaazjNUIB7cJK5AP7WR8XXHU2ryg5w285PmL\n\tAODSGtDF1hULxIghPkKwRBZ4SC8RjzxRkwX9VS/tMlg+ibSVrKwOe0g0IkUFiUR8ZI\n\ti/LIp2Btc7YOMFJm/oJy5I629q0YFwS43CxXq5qVSKSPmq3Wmsko3gegl+I4YIfRVE\n\tB1vkLYioL9oEw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"PgAeNCoZ\"; dkim-atps=neutral","Message-ID":"<c0cecf11d733fe930326b5234863e88f9b5b9467.camel@collabora.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 27 Jun 2022 16:48:56 -0400","In-Reply-To":"<20220623232210.18742-5-laurent.pinchart@ideasonboard.com>","References":"<20220623232210.18742-1-laurent.pinchart@ideasonboard.com>\n\t<20220623232210.18742-5-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.44.2 (3.44.2-1.fc36) ","MIME-Version":"1.0","Subject":"Re: [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":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23659,"web_url":"https://patchwork.libcamera.org/comment/23659/","msgid":"<5ab9da43-6e0a-5617-4d48-0094823cb2fb@ideasonboard.com>","date":"2022-06-29T11:31:22","subject":"Re: [libcamera-devel] [PATCH 04/13] gstreamer: Pass Stream to\n\tRequestWrap::addBuffer()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nThank you for the patch.\n\nOn 6/24/22 04:52, Laurent Pinchart via libcamera-devel wrote:\n> For symmetry with RequestWrap::removeBuffer(), pass the Stream pointer\n> to addBuffer(). This handles streams at the GstPad level instead of the\n> GstBuffer level, which allows making the GstLibcameraPool API a bit\n> cleaner by removing the gst_libcamera_buffer_get_stream() helper\n> function.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\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(-)\n>\n> diff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp\n> index 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> -}\n> diff --git a/src/gstreamer/gstlibcamerapool.h b/src/gstreamer/gstlibcamerapool.h\n> index 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);\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 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) {","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 4D623BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jun 2022 11:31:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8084865635;\n\tWed, 29 Jun 2022 13:31:32 +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 166D460412\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 13:31:30 +0200 (CEST)","from [IPV6:2401:4900:1f3f:ca21:e286:106b:5da4:9482] (unknown\n\t[IPv6:2401:4900:1f3f:ca21:e286:106b:5da4:9482])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AB2623D7;\n\tWed, 29 Jun 2022 13:31:28 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656502292;\n\tbh=mbpQ/svunwYuFWHo5fIxX+qjUK1X9D45XTmGRp589+M=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=jJZjOX2kxGwIGS8MLl5cQnd5zSYQvH3FF+8E67qQ1mQN3ra/FvEsFFoXFTpYv6zHs\n\tQ/HfiwE+yyBFL/xqrPLIKUVBafqSS8aJlqAlVzbwRYPl7qOGPGutQGE9acyagiOmog\n\tvo91fWeBDUajhjUtOh5mYRJ2+TkIys/nmYd87GqZJer3h7kt5D/cNmwtsUFPt7oDN0\n\tWUpNyUBmLiVJFftZyDLfONp/q3zpkJQvTxcNGi59LbEgpp8EiC+A7QZGVRcpd8vICm\n\tUR/R0eY6hoSlAhJ2GgoEd13mwlWg5o9Q9VK6PitLhxNtae9OCJWiRhNWQx/rzX6ixo\n\tv1PB1scrUdxiA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656502289;\n\tbh=mbpQ/svunwYuFWHo5fIxX+qjUK1X9D45XTmGRp589+M=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=WIaTDdyA99R6Bf6F/Eeuj/DMFrcTanaVItNFeU6gf+HTX4eYF8jN9fnqdBLnRv0uB\n\t04UG4nQxgqpMRFPjMYA0+XMVzy84+hUZfgWRBeNIOPXro/fGqhQi8pSAryDDKSk7Ry\n\tYh/dslR1plFZi/FExChitb1+J/LKcx5hjHk3B//w="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WIaTDdyA\"; dkim-atps=neutral","Message-ID":"<5ab9da43-6e0a-5617-4d48-0094823cb2fb@ideasonboard.com>","Date":"Wed, 29 Jun 2022 17:01:22 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220623232210.18742-1-laurent.pinchart@ideasonboard.com>\n\t<20220623232210.18742-5-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220623232210.18742-5-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@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>"}}]