[{"id":18370,"web_url":"https://patchwork.libcamera.org/comment/18370/","msgid":"<9b35c5755f92be770908038e2e88f9996562a5e5.camel@ndufresne.ca>","date":"2021-07-26T21:03:45","subject":"Re: [libcamera-devel] [PATCH v4] gstreamer: Store group_id in\n\tGstLibcameraSrcState","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le mardi 20 juillet 2021 à 21:30 +0530, Vedant Paranjape a écrit :\n> This patch adds group_id in GstLibcameraSrcState, since group_id is\n> something which should be same for all the pads, it can be reused\n> later.\n> \n> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n\nThanks for this version, I think this is good.\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index ea53c2b5..b18f1efb 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -113,6 +113,7 @@ struct GstLibcameraSrcState {\n>  \tstd::unique_ptr<CameraConfiguration> config_;\n>  \tstd::vector<GstPad *> srcpads_;\n>  \tstd::queue<std::unique_ptr<RequestWrap>> requests_;\n> +\tguint group_id_;\n>  \n>  \tvoid requestCompleted(Request *request);\n>  };\n> @@ -360,15 +361,14 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>  \n>  \tGST_DEBUG_OBJECT(self, \"Streaming thread has started\");\n>  \n> -\tguint group_id = gst_util_group_id_next();\n>  \tgint stream_id_num = 0;\n>  \tStreamRoles roles;\n>  \tfor (GstPad *srcpad : state->srcpads_) {\n>  \t\t/* Create stream-id and push stream-start. */\n> -\t\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", group_id, stream_id_num++);\n> +\t\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", state->group_id_, stream_id_num++);\n>  \t\tg_autofree gchar *stream_id = gst_pad_create_stream_id(srcpad, GST_ELEMENT(self), stream_id_intermediate);\n>  \t\tGstEvent *event = gst_event_new_stream_start(stream_id);\n> -\t\tgst_event_set_group_id(event, group_id);\n> +\t\tgst_event_set_group_id(event, state->group_id_);\n>  \t\tgst_pad_push_event(srcpad, event);\n>  \n>  \t\t/* Collect the streams roles for the next iteration. */\n> @@ -578,6 +578,7 @@ gst_libcamera_src_change_state(GstElement *element, GstStateChange transition)\n>  \t\tbreak;\n>  \tcase GST_STATE_CHANGE_READY_TO_PAUSED:\n>  \t\t/* This needs to be called after pads activation.*/\n> +\t\tself->state->group_id_ = gst_util_group_id_next();\n>  \t\tif (!gst_task_pause(self->task))\n>  \t\t\treturn GST_STATE_CHANGE_FAILURE;\n>  \t\tret = GST_STATE_CHANGE_NO_PREROLL;","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 D2BF8C322C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jul 2021 21:03:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2088E687BF;\n\tMon, 26 Jul 2021 23:03:51 +0200 (CEST)","from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com\n\t[IPv6:2607:f8b0:4864:20::f2b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E914687AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jul 2021 23:03:49 +0200 (CEST)","by mail-qv1-xf2b.google.com with SMTP id jm13so5846919qvb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jul 2021 14:03:49 -0700 (PDT)","from nicolas-tpx395.localdomain (173-246-12-168.qc.cable.ebox.net.\n\t[173.246.12.168]) by smtp.gmail.com with ESMTPSA id\n\t197sm605435qkn.64.2021.07.26.14.03.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 26 Jul 2021 14:03:47 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ndufresne-ca.20150623.gappssmtp.com\n\theader.i=@ndufresne-ca.20150623.gappssmtp.com\n\theader.b=\"gJoaIjHy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20150623.gappssmtp.com; s=20150623;\n\th=message-id:subject:from:to:date:in-reply-to:references:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=7xzGj6rWZZFDgF7bnZmDz7QB+qrKfpybUY8C/JDXgz8=;\n\tb=gJoaIjHyA3UxXoHqd3jyh6AH2Dlt0gTNCY/GAaL/LHzThOOQgsTHQ/ge86O0K0csnz\n\t4AHRVXdt+Sc0POgI49XYrWX5IFORaM9zDP9vNbmGfiotIjyruVDZFYZCngpIhSoOyTFF\n\teHx9cQf+I0e8F03nEd54MqG9bx7Vi61CtpCDYHUpSW420xHhPDeRKdNpPreeTqe48m1G\n\tD9euZ+C5FPth0X3Vzln7nsbV+XxZqSmjD+LYzq9AV2UNhWQonfH3THE9GNbWeVtHIu0+\n\tVvFc9vJKusp/6PedUB3zT5ttDzRUJTVUX2rSfoMuy5HlgCs/Qy+ptM9tNDM/ldlre5W+\n\tJiYg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:message-id:subject:from:to:date:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=7xzGj6rWZZFDgF7bnZmDz7QB+qrKfpybUY8C/JDXgz8=;\n\tb=Sw+6wIOwD9Je4K+Pw6ApNwz+gP3ACkeYiPycKA6XVG8KuCXRN4Sn+mnbORC5MrVRvS\n\ts4MUTnlQWaEqevn3MLriPwhCR3QucYzhzTIulkpzzijd9v6IPDLL61VkDTTqMuDgll0S\n\tCGjQU6Tee5SujsHPBvjubkBRcODX7BzAwPO5s4U86w16Zs7N+Dp4oSRWcUHYj9atOmgV\n\tWLBAEZD27zK21jtXdsIQJqd1CbDFINbZyrzpRvIysLU5AhAeVzplMQFD3UpsPVHo6KjJ\n\tFxq46qnIUSo40SVGmQoB3t4PNkF3L49RSk+dTgcleRcQa5wvVFqp/37gLErFYf2sJnGi\n\tB9pw==","X-Gm-Message-State":"AOAM5307HMq8EjivKI0KHeSA8h0Y2BqqJ00fzhq7dRDWgpNgavEBBva3\n\tlY+5bHP26kb2jdR2P1Gc71JcWQ==","X-Google-Smtp-Source":"ABdhPJxY40nK7kFIuMlwoEwtD8d/QjcshRwlYtjvf5+Evn+jeFV95jrDetJHigWgFUnPvh9QZN5ODg==","X-Received":"by 2002:a0c:fe0b:: with SMTP id\n\tx11mr20041101qvr.56.1627333428190; \n\tMon, 26 Jul 2021 14:03:48 -0700 (PDT)","Message-ID":"<9b35c5755f92be770908038e2e88f9996562a5e5.camel@ndufresne.ca>","From":"Nicolas Dufresne <nicolas@ndufresne.ca>","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 26 Jul 2021 17:03:45 -0400","In-Reply-To":"<20210720160034.233363-1-vedantparanjape160201@gmail.com>","References":"<20210720160034.233363-1-vedantparanjape160201@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","User-Agent":"Evolution 3.40.3 (3.40.3-1.fc34) ","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v4] gstreamer: Store group_id in\n\tGstLibcameraSrcState","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18391,"web_url":"https://patchwork.libcamera.org/comment/18391/","msgid":"<20210728014519.GD2167@pyrite.rasen.tech>","date":"2021-07-28T01:45:19","subject":"Re: [libcamera-devel] [PATCH v4] gstreamer: Store group_id in\n\tGstLibcameraSrcState","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Vedant,\n\nOn Tue, Jul 20, 2021 at 09:30:34PM +0530, Vedant Paranjape wrote:\n> This patch adds group_id in GstLibcameraSrcState, since group_id is\n> something which should be same for all the pads, it can be reused\n> later.\n> \n> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n\nLooks good.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\nAnd pushed.\n\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index ea53c2b5..b18f1efb 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -113,6 +113,7 @@ struct GstLibcameraSrcState {\n>  \tstd::unique_ptr<CameraConfiguration> config_;\n>  \tstd::vector<GstPad *> srcpads_;\n>  \tstd::queue<std::unique_ptr<RequestWrap>> requests_;\n> +\tguint group_id_;\n>  \n>  \tvoid requestCompleted(Request *request);\n>  };\n> @@ -360,15 +361,14 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>  \n>  \tGST_DEBUG_OBJECT(self, \"Streaming thread has started\");\n>  \n> -\tguint group_id = gst_util_group_id_next();\n>  \tgint stream_id_num = 0;\n>  \tStreamRoles roles;\n>  \tfor (GstPad *srcpad : state->srcpads_) {\n>  \t\t/* Create stream-id and push stream-start. */\n> -\t\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", group_id, stream_id_num++);\n> +\t\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", state->group_id_, stream_id_num++);\n>  \t\tg_autofree gchar *stream_id = gst_pad_create_stream_id(srcpad, GST_ELEMENT(self), stream_id_intermediate);\n>  \t\tGstEvent *event = gst_event_new_stream_start(stream_id);\n> -\t\tgst_event_set_group_id(event, group_id);\n> +\t\tgst_event_set_group_id(event, state->group_id_);\n>  \t\tgst_pad_push_event(srcpad, event);\n>  \n>  \t\t/* Collect the streams roles for the next iteration. */\n> @@ -578,6 +578,7 @@ gst_libcamera_src_change_state(GstElement *element, GstStateChange transition)\n>  \t\tbreak;\n>  \tcase GST_STATE_CHANGE_READY_TO_PAUSED:\n>  \t\t/* This needs to be called after pads activation.*/\n> +\t\tself->state->group_id_ = gst_util_group_id_next();\n>  \t\tif (!gst_task_pause(self->task))\n>  \t\t\treturn GST_STATE_CHANGE_FAILURE;\n>  \t\tret = GST_STATE_CHANGE_NO_PREROLL;\n> -- \n> 2.25.1\n>","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 A8E09C3230\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Jul 2021 01:45:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E3A7F687C4;\n\tWed, 28 Jul 2021 03:45:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD8B7687AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jul 2021 03:45:28 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A361EE;\n\tWed, 28 Jul 2021 03:45:26 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QE5APgx1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1627436728;\n\tbh=fyvskrq+Ci/eLFupfpTkNs2IepRow7jRXFsX96/Hn4A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QE5APgx1wRJxBVvRkwNrvfJBptvBwscmmJWps4P808buPe6nkefOkfS6B75s6nRyg\n\t0osv/PWThyqJ7hagc/zw4/AlpglJXN3yqLVf1WqzeCHOSWP7sjoRms7VbEYGTg7svb\n\tuFXRQGVl0VXJCtuP9hI773XmOeE79Z8iJxR3rb/A=","Date":"Wed, 28 Jul 2021 10:45:19 +0900","From":"paul.elder@ideasonboard.com","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Message-ID":"<20210728014519.GD2167@pyrite.rasen.tech>","References":"<20210720160034.233363-1-vedantparanjape160201@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20210720160034.233363-1-vedantparanjape160201@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v4] gstreamer: Store group_id in\n\tGstLibcameraSrcState","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]