[{"id":18368,"web_url":"https://patchwork.libcamera.org/comment/18368/","msgid":"<e5ca30d6a291c3504c73cdc4f0bee7b0be651929.camel@ndufresne.ca>","date":"2021-07-26T19:26:30","subject":"Re: [libcamera-devel] [RFC PATCH v1 1/2] gstreamer: Factor out\n\t_pad_push_stream_start from _task_enter","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Hi Vedant,\n\nLe mardi 20 juillet 2021 à 23:05 +0530, Vedant Paranjape a écrit :\n> This patch creates gst_libcamera_pad_push_stream_start function to\n> create stream id and to push the stream start. This is a non functional\n> change.\n\nThanks for the patch, non-functional changes means that code have been moved. In\nthis case you simply duplicate it. Perhaps you could rework the patch split and\nmake sure the new helper is used ?\n\n> \n> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n> ---\n>  src/gstreamer/gstlibcamerapad.cpp | 13 +++++++++++++\n>  src/gstreamer/gstlibcamerapad.h   |  2 ++\n>  2 files changed, 15 insertions(+)\n> \n> diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp\n> index c00e81c8..c5bd14f0 100644\n> --- a/src/gstreamer/gstlibcamerapad.cpp\n> +++ b/src/gstreamer/gstlibcamerapad.cpp\n> @@ -155,6 +155,19 @@ gst_libcamera_pad_get_stream(GstPad *pad)\n>  \treturn nullptr;\n>  }\n>  \n> +void\n> +gst_libcamera_pad_push_stream_start(GstPad *pad, const guint group_id)\n> +{\n> +\tg_autoptr(GstElement) element = gst_pad_get_parent_element(pad);\n> +\tstatic gint stream_id_num = 0;\n> +\n> +\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", group_id, g_atomic_int_add(&stream_id_num, 1));\n> +\tg_autofree gchar *stream_id = gst_pad_create_stream_id(pad, element, stream_id_intermediate);\n> +\tGstEvent *event = gst_event_new_stream_start(stream_id);\n> +\tgst_event_set_group_id(event, group_id);\n> +\tgst_pad_push_event(pad, event);\n> +}\n> +\n>  void\n>  gst_libcamera_pad_queue_buffer(GstPad *pad, GstBuffer *buffer)\n>  {\n> diff --git a/src/gstreamer/gstlibcamerapad.h b/src/gstreamer/gstlibcamerapad.h\n> index 779f2d13..7693374f 100644\n> --- a/src/gstreamer/gstlibcamerapad.h\n> +++ b/src/gstreamer/gstlibcamerapad.h\n> @@ -26,6 +26,8 @@ void gst_libcamera_pad_set_pool(GstPad *pad, GstLibcameraPool *pool);\n>  \n>  libcamera::Stream *gst_libcamera_pad_get_stream(GstPad *pad);\n>  \n> +void gst_libcamera_pad_push_stream_start(GstPad *pad, const guint group_id);\n> +\n>  void gst_libcamera_pad_queue_buffer(GstPad *pad, GstBuffer *buffer);\n>  \n>  GstFlowReturn gst_libcamera_pad_push_pending(GstPad *pad);","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 D3A3FC322C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jul 2021 19:26:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D9197687BF;\n\tMon, 26 Jul 2021 21:26:35 +0200 (CEST)","from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com\n\t[IPv6:2607:f8b0:4864:20::f2f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EEA18687AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jul 2021 21:26:33 +0200 (CEST)","by mail-qv1-xf2f.google.com with SMTP id db14so4916863qvb.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jul 2021 12:26:33 -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\tr13sm403453qtt.38.2021.07.26.12.26.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 26 Jul 2021 12:26:32 -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=\"oKZlgiAe\"; 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=Tao7rrwp2O8eGhqUiocL0tpfRW/1uBOegUvWWFQSZkM=;\n\tb=oKZlgiAekcJ1JcbQQ4b15We/EySKwOCdQtd8+Gkdqmw83oaspKaL3Z6owbIecGLtcW\n\tEMi0zYQpTFdVM03Q4wYblFDIc4mlqUqEwNTvfbhvIRpoRea+U2wCX6jxY4v6F7GpXdbr\n\tAvpzFPR6Gkxuzf8Nz5mE48Bgkih92IbRETZPGd56/96rbYoxlPtBKL/WnvAryL3b52jp\n\tN1lq6kpTwujBw+kNJ7y4gISpJr7PjUa1kKM5kHps6EfGVst+Bc9nLd97MGddmueJOFXb\n\tfzbhBCJTa23/0P128TrLZrHIb4xIqlhzOvvlo/jFmeBz6/NjEvU3gNYnHf+gMKf2D9Ky\n\t9x1A==","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=Tao7rrwp2O8eGhqUiocL0tpfRW/1uBOegUvWWFQSZkM=;\n\tb=t4d3qDmUlW4+OvLFdphKEjAXrsMbdZDGpeW5oaTqtrz0we7+K+eZZMYfIQFwQ2Jll6\n\trSI74v2xgueKWQ4njQaWHMNhw3/8UoqrLNnFGgShwXkIkechWkKDTbfF9CkYSf2iPytn\n\tIsu5hiMy4UM7LZasr4TiNhCCvDsBNEuotetKDFF8PJkAG0wH2W2YyerqgnvMJzedkZ8M\n\t4EtYI+LwEE4nqmxqzT2hUnSksTQLrR0nNZzJ+WBhPoz8zitYc/DwUvwvAJOYkeiIxdcI\n\t/hcQnsIpPQ4MK52Cq9/EGu4QEgDFE8OTBUOqhUGNVyux46dRkIPDUTVGnstFx0JK+A7b\n\tc0Jg==","X-Gm-Message-State":"AOAM530aVF7DhF5+p+Q8wLgtCVO4HhLdGjj4dN2scDssGqnzsFI6lt1W\n\tHcnhcmk3/IuZQrlIVTdE4Aj5Bg==","X-Google-Smtp-Source":"ABdhPJzDSNs+0zEeyDGoMUMbzKZ2zFfif0xKXRe+odOIrG7KKBBdn0qAM7Pa0+xFYRueN06/FLmT0g==","X-Received":"by 2002:a05:6214:1882:: with SMTP id\n\tcx2mr19358927qvb.2.1627327592641; \n\tMon, 26 Jul 2021 12:26:32 -0700 (PDT)","Message-ID":"<e5ca30d6a291c3504c73cdc4f0bee7b0be651929.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 15:26:30 -0400","In-Reply-To":"<20210720173548.313901-1-vedantparanjape160201@gmail.com>","References":"<20210720173548.313901-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] [RFC PATCH v1 1/2] gstreamer: Factor out\n\t_pad_push_stream_start from _task_enter","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":18369,"web_url":"https://patchwork.libcamera.org/comment/18369/","msgid":"<CACGrz-N4Q7ZMoFgJRmwfmqM+hYF3kraL-gKP0711WYp17o-E2w@mail.gmail.com>","date":"2021-07-26T19:39:01","subject":"Re: [libcamera-devel] [RFC PATCH v1 1/2] gstreamer: Factor out\n\t_pad_push_stream_start from _task_enter","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"content":"Hi Nicolas,\nHere's the patch: https://patchwork.libcamera.org/patch/13063/\n\nRegards,\n*Vedant Paranjape*\n\nOn Tue, Jul 27, 2021 at 12:56 AM Nicolas Dufresne <nicolas@ndufresne.ca>\nwrote:\n\n> Hi Vedant,\n>\n> Le mardi 20 juillet 2021 à 23:05 +0530, Vedant Paranjape a écrit :\n> > This patch creates gst_libcamera_pad_push_stream_start function to\n> > create stream id and to push the stream start. This is a non functional\n> > change.\n>\n> Thanks for the patch, non-functional changes means that code have been\n> moved. In\n> this case you simply duplicate it. Perhaps you could rework the patch\n> split and\n> make sure the new helper is used ?\n>\n> >\n> > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n> > ---\n> >  src/gstreamer/gstlibcamerapad.cpp | 13 +++++++++++++\n> >  src/gstreamer/gstlibcamerapad.h   |  2 ++\n> >  2 files changed, 15 insertions(+)\n> >\n> > diff --git a/src/gstreamer/gstlibcamerapad.cpp\n> b/src/gstreamer/gstlibcamerapad.cpp\n> > index c00e81c8..c5bd14f0 100644\n> > --- a/src/gstreamer/gstlibcamerapad.cpp\n> > +++ b/src/gstreamer/gstlibcamerapad.cpp\n> > @@ -155,6 +155,19 @@ gst_libcamera_pad_get_stream(GstPad *pad)\n> >       return nullptr;\n> >  }\n> >\n> > +void\n> > +gst_libcamera_pad_push_stream_start(GstPad *pad, const guint group_id)\n> > +{\n> > +     g_autoptr(GstElement) element = gst_pad_get_parent_element(pad);\n> > +     static gint stream_id_num = 0;\n> > +\n> > +     g_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\",\n> group_id, g_atomic_int_add(&stream_id_num, 1));\n> > +     g_autofree gchar *stream_id = gst_pad_create_stream_id(pad,\n> element, stream_id_intermediate);\n> > +     GstEvent *event = gst_event_new_stream_start(stream_id);\n> > +     gst_event_set_group_id(event, group_id);\n> > +     gst_pad_push_event(pad, event);\n> > +}\n> > +\n> >  void\n> >  gst_libcamera_pad_queue_buffer(GstPad *pad, GstBuffer *buffer)\n> >  {\n> > diff --git a/src/gstreamer/gstlibcamerapad.h\n> b/src/gstreamer/gstlibcamerapad.h\n> > index 779f2d13..7693374f 100644\n> > --- a/src/gstreamer/gstlibcamerapad.h\n> > +++ b/src/gstreamer/gstlibcamerapad.h\n> > @@ -26,6 +26,8 @@ void gst_libcamera_pad_set_pool(GstPad *pad,\n> GstLibcameraPool *pool);\n> >\n> >  libcamera::Stream *gst_libcamera_pad_get_stream(GstPad *pad);\n> >\n> > +void gst_libcamera_pad_push_stream_start(GstPad *pad, const guint\n> group_id);\n> > +\n> >  void gst_libcamera_pad_queue_buffer(GstPad *pad, GstBuffer *buffer);\n> >\n> >  GstFlowReturn gst_libcamera_pad_push_pending(GstPad *pad);\n>\n>\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 DBB70C0109\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jul 2021 19:39:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C0F5687BA;\n\tMon, 26 Jul 2021 21:39:16 +0200 (CEST)","from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com\n\t[IPv6:2607:f8b0:4864:20::b2a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2ACE8687AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jul 2021 21:39:15 +0200 (CEST)","by mail-yb1-xb2a.google.com with SMTP id d73so16649471ybc.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jul 2021 12:39:15 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"t2E6u3E8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=7w9T8K4xLSj1avHWfUq1lLZGItAL+Wq0TkHsywBXykc=;\n\tb=t2E6u3E8N9K5ZYGFyYsPmgTE6IgaIFAKKxS1yd1xvuvn/Vkr7CYZrYVs6zv7YVhKTd\n\tzH1D1IC3Ty3FIi+cJDp77+MSAXl1GtCkYJoPlNFK5CpsDOGY8S2zBtMMUNPrkQznAyiZ\n\td3tPqRKDA60TJtIUTjBMd9OXjIku/0khS4HBAoWz16Gue5VcUmZHN6B8RK4FepgnsiCg\n\t8At95koDcATEPkY79Gqs6Nd93Ln4kM219LcOHhh1bu8Ox7Q9FGC/JHwaT9BlcDk8uIoy\n\tWc4YuGjeN59LNPPlf298FHO5uAkm8hJ9+bLWvsbwfGbxj+OP6CbcBvy/DmFszpreMCOQ\n\tmsbw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=7w9T8K4xLSj1avHWfUq1lLZGItAL+Wq0TkHsywBXykc=;\n\tb=pLEUx49H4g+Cs0PQkB4S71tnEBSA3g9rcvMUyRzU0lBWeKYMTQgu5jMPixLy7eZNqt\n\t/DwXL3BiM+yAUAVJGRCKSyfMFwsIFiR1vH4OYYyk/1CNbveOJvcnAzFEcAr/iykIZUXK\n\t7Bm+iwrvMj+tgx4tWerXRFn96lnvQZQKzgHhxNCI0tr+aDyjtckW/Jc4yHkVzgWXxFhE\n\t7Gg//i9Dx162M1p3eBNL1QOtyY4NV7/5tPPQ5gdt6bGLAI2HgCXhJs3w65uUN8YOnX7W\n\t863PgPPlrGE1GyR8sj4U+7hIBE7+ZCjkGkEdgyX2BEsuXqDSWg3sKTD7DVTVFKjhr9W7\n\tVWeA==","X-Gm-Message-State":"AOAM5330nVKsIhvqmFnWWReUAHPX3pvJM66wjW74NSoumSFQescVncuE\n\ty1P/d4P37oXSbHXPiOEwDZBHJwlkVr+0B9ToOC0=","X-Google-Smtp-Source":"ABdhPJxuqJZHerb+d++N+MnCc3fqUvjev7Cbf6kBXKoIUi6kqNonvtQf1ydnhriFnw23vNanOK8S1kuW/vyzVQXW5/U=","X-Received":"by 2002:a25:7647:: with SMTP id\n\tr68mr27220789ybc.432.1627328353825; \n\tMon, 26 Jul 2021 12:39:13 -0700 (PDT)","MIME-Version":"1.0","References":"<20210720173548.313901-1-vedantparanjape160201@gmail.com>\n\t<e5ca30d6a291c3504c73cdc4f0bee7b0be651929.camel@ndufresne.ca>","In-Reply-To":"<e5ca30d6a291c3504c73cdc4f0bee7b0be651929.camel@ndufresne.ca>","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Date":"Tue, 27 Jul 2021 01:09:01 +0530","Message-ID":"<CACGrz-N4Q7ZMoFgJRmwfmqM+hYF3kraL-gKP0711WYp17o-E2w@mail.gmail.com>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Content-Type":"multipart/alternative; boundary=\"00000000000076790c05c80be8af\"","Subject":"Re: [libcamera-devel] [RFC PATCH v1 1/2] gstreamer: Factor out\n\t_pad_push_stream_start from _task_enter","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>"}}]