Show a patch.

GET /api/patches/13174/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 13174,
    "url": "https://patchwork.libcamera.org/api/patches/13174/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13174/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20210801185144.21572-1-vedantparanjape160201@gmail.com>",
    "date": "2021-08-01T18:51:44",
    "name": "[libcamera-devel,RFC,v2] gstreamer: Factor out _pad_push_stream_start from _task_enter",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "10592e72d5057bdcd3aaee63b96d611d8614b109",
    "submitter": {
        "id": 85,
        "url": "https://patchwork.libcamera.org/api/people/85/?format=api",
        "name": "Vedant Paranjape",
        "email": "vedantparanjape160201@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13174/mbox/",
    "series": [
        {
            "id": 2293,
            "url": "https://patchwork.libcamera.org/api/series/2293/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2293",
            "date": "2021-08-01T18:51:44",
            "name": "[libcamera-devel,RFC,v2] gstreamer: Factor out _pad_push_stream_start from _task_enter",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2293/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13174/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13174/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 ECF04BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  1 Aug 2021 18:52:09 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 43352687B1;\n\tSun,  1 Aug 2021 20:52:09 +0200 (CEST)",
            "from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com\n\t[IPv6:2607:f8b0:4864:20::1031])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2EB6687B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  1 Aug 2021 20:52:07 +0200 (CEST)",
            "by mail-pj1-x1031.google.com with SMTP id j1so22322771pjv.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 01 Aug 2021 11:52:07 -0700 (PDT)",
            "from localhost.localdomain ([1.186.166.116])\n\tby smtp.googlemail.com with ESMTPSA id\n\td9sm9968311pgm.89.2021.08.01.11.52.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 01 Aug 2021 11:52:05 -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=\"OamRZLaC\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=SBH+mi43u+IxJlu4Rvq9i0XtiCXwKHN3d7cn6OkBSpw=;\n\tb=OamRZLaC5EC7J0WNaGaESQlF5wj+atFMrcQ9lexZ+ui9jqcUHR4ZAF5VWdPqrk4hOP\n\t3cx73kYOX0xdGlTzpNu8HNaVld1eWYSjM+chgiQRb48Ph5ciyNbGiBOaEy2MBiO6f0xF\n\t1uZL+icktv5mEs8SQepbRkQgz4Wff2s1bJD26yLj6+Gq1FLT5GWmcWJ3A08SfpASBd+0\n\t0ucWf8OeNIJqawOAdyHP1dy8d8oTlErX5UmKJ3vBVjXJK2BfMKpkuLt1UHgNIh3ll6D0\n\t3mzBswBca/vCFktp8ux4d1mrhxH+bsIij/59j4dVNRWNC4iV1eemzJiWjDf/ea8n6bnn\n\t0D1A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=SBH+mi43u+IxJlu4Rvq9i0XtiCXwKHN3d7cn6OkBSpw=;\n\tb=pERx1WgOmI+T6OXnyEkZyEHvu0jH/vL+N8g0lF+gEtrJTzEfJb5QyWHRbkrw/cpLVt\n\t+O3BCb573aDnW+kj9T4dCtWqbYF+khM+sd3S2xMAcJMfrq6JaSDAiKitQ6jntBQQnaLL\n\tPP7cn+wm+L9g6Uecw6lQeNwWpbJf9CwsQKhpdJf5XlchA7m1YlOnXU8OiZ1IzUXiTk0p\n\tEXMLFM3ezhp7NkM7QDs7i6hCYPQJCpFyaamKT5odHMf+d7Zmu4MXcxNVNbAHJvTQmVnK\n\tk6JBWoPSRoB+C8qEhtXILNgi4Enwuj4JmLl7nL1Ad4UXYH1nUmvy9dwrMU2O1noBtevB\n\tWSnA==",
        "X-Gm-Message-State": "AOAM533NVxDhr8hK6Lp59uuh0SlpUifOrHRzSEpzOaSDePT+F+8jqWrd\n\t+b190G3RsPXC+PmCBgyj90++mDcyZD83Lg==",
        "X-Google-Smtp-Source": "ABdhPJwCxOsd+7qmmwbXuR9+CDUBBl3hbPY5nwK+T9YhuAt2rEycjfnHO4x3gQOelKyDcZ6p8Rvofw==",
        "X-Received": "by 2002:a05:6a00:1245:b029:30f:2098:fcf4 with SMTP id\n\tu5-20020a056a001245b029030f2098fcf4mr13233997pfi.66.1627843925443; \n\tSun, 01 Aug 2021 11:52:05 -0700 (PDT)",
        "From": "Vedant Paranjape <vedantparanjape160201@gmail.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  2 Aug 2021 00:21:44 +0530",
        "Message-Id": "<20210801185144.21572-1-vedantparanjape160201@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH v2] 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": "Vedant Paranjape <vedantparanjape160201@gmail.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "This patch creates gst_libcamera_pad_push_stream_start function to\ncreate stream id and to push the stream start.\n\nUpdate functional code in gst_libcamera_src_task_enter(), which creates\nstream id and pushes the stream start with the refactored\nfunction gst_libcamera_pad_push_stream_start().\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n src/gstreamer/gstlibcamerapad.cpp | 19 +++++++++++++++++++\n src/gstreamer/gstlibcamerapad.h   |  2 ++\n src/gstreamer/gstlibcamerasrc.cpp |  7 +------\n 3 files changed, 22 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp\nindex c00e81c8..d4211050 100644\n--- a/src/gstreamer/gstlibcamerapad.cpp\n+++ b/src/gstreamer/gstlibcamerapad.cpp\n@@ -20,6 +20,7 @@ struct _GstLibcameraPad {\n \tGstLibcameraPool *pool;\n \tGQueue pending_buffers;\n \tGstClockTime latency;\n+\tgint stream_id_num;\n };\n \n enum {\n@@ -81,6 +82,7 @@ static void\n gst_libcamera_pad_init(GstLibcameraPad *self)\n {\n \tGST_PAD_QUERYFUNC(self) = gst_libcamera_pad_query;\n+\tself->stream_id_num = 0;\n }\n \n static GType\n@@ -155,6 +157,23 @@ 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+\tauto *self = GST_LIBCAMERA_PAD(pad);\t\n+\t{\n+\t\tGLibLocker lock(GST_OBJECT(self));\n+\t\tself->stream_id_num++;\n+\t}\n+\n+\tg_autoptr(GstElement) element = gst_pad_get_parent_element(pad);\n+\tg_autofree gchar *stream_id_intermediate = g_strdup_printf(\"%i%i\", group_id, self->stream_id_num);\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 {\ndiff --git a/src/gstreamer/gstlibcamerapad.h b/src/gstreamer/gstlibcamerapad.h\nindex 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);\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex b18f1efb..bb8ea07a 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -361,15 +361,10 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n \n \tGST_DEBUG_OBJECT(self, \"Streaming thread has started\");\n \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\", 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, state->group_id_);\n-\t\tgst_pad_push_event(srcpad, event);\n+\t\tgst_libcamera_pad_push_stream_start(srcpad, state->group_id_);\n \n \t\t/* Collect the streams roles for the next iteration. */\n \t\troles.push_back(gst_libcamera_pad_get_role(srcpad));\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "v2"
    ]
}