Show a patch.

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

{
    "id": 13915,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13915/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13915/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20210924083821.1877829-1-vedantparanjape160201@gmail.com>",
    "date": "2021-09-24T08:38:21",
    "name": "[libcamera-devel,v4] test: gstreamer: Add a test for gstreamer multi stream",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3fb46f97e045c9a10e9f202e6def918595610468",
    "submitter": {
        "id": 85,
        "url": "https://patchwork.libcamera.org/api/1.1/people/85/?format=api",
        "name": "Vedant Paranjape",
        "email": "vedantparanjape160201@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13915/mbox/",
    "series": [
        {
            "id": 2558,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2558/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2558",
            "date": "2021-09-24T08:38:21",
            "name": "[libcamera-devel,v4] test: gstreamer: Add a test for gstreamer multi stream",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/2558/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13915/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13915/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 DEFCCBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Sep 2021 08:38:43 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 492946918C;\n\tFri, 24 Sep 2021 10:38:43 +0200 (CEST)",
            "from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com\n\t[IPv6:2607:f8b0:4864:20::52e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C4E1669186\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Sep 2021 10:38:41 +0200 (CEST)",
            "by mail-pg1-x52e.google.com with SMTP id h3so9201830pgb.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Sep 2021 01:38:41 -0700 (PDT)",
            "from localhost.localdomain ([1.186.166.87])\n\tby smtp.googlemail.com with ESMTPSA id\n\tr193sm8031281pfc.197.2021.09.24.01.38.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 24 Sep 2021 01:38:39 -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=\"eFUXLdv7\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=jeroYbT5KgzVxEr5O9znVCb1/rD84k/duYTn3HfB+oI=;\n\tb=eFUXLdv7F0NKs7+1e7aVbTGpzTkiLf9bBXvZJd/TQCYbgHFjeOsmTyC/F2A6hRZ9CY\n\t6i2WHYYmklhCLhfYeSjErD0P6C2azjS2Oq7b/NCjghwg0dv1aVVtEgMQUkmDQxA0zqJY\n\tiA9TYfQQBsDjgLgJ8kSQKzqwvIL0Pbmd3RGMHrY3wzaPAk8RzlzDivd1Wr26wUECpvD/\n\tf6SpaDXTxMPFf0XTaeKNW/YdD+i9674R3Z4MhKQsv+myTBVuGQO2kx3jZc1jmsp1NOtR\n\t//053cK51CyWIrk4w1PvPxrpxltRcGSmVXIIQ0erxFm+VzXcsE+yF1bwPsgg5JQoh39t\n\tLhBw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=jeroYbT5KgzVxEr5O9znVCb1/rD84k/duYTn3HfB+oI=;\n\tb=RCbB2d50xegmPv+PWmAZ3jaYmHTPjhdgZvJd8s4AiaHyhw30Ute2U8sQVayFhHCtIp\n\tPFtJMIn+Sm/evnh/3Y1vUGNs71PyucgxXmqvlUiR+DpUmN3m+pfSjuS+yzre56Tc9uio\n\t2sZRvJ1kFDsmNFm19Y9/IUWBaFPsgvJ05+QQQgPXqNkeIOliUiq2uHefqOsgNZGbXKuu\n\tOnVW82lAWjGsDAX39C62bVTn42FUzCHxotEg0i2ZqrMD3pYZOFOOIGQSxyK2UGHa+EDs\n\t3R9fw+G7zspkPRxBmJ7RyHtcO+Rpn7vaYRbblPtyL9Qc9rYd8dmysKEo9yont/SOnQe9\n\tFMLw==",
        "X-Gm-Message-State": "AOAM533dyZXtFzTcY68CG70k4Kw2MbLp005cfdzVuboP1kw1yPd2bdic\n\tWGSZJcOF5L7pBrUXObKZqQBsV6g23YqkUy6r",
        "X-Google-Smtp-Source": "ABdhPJyhMI+++Old/VWwwFpPOi+DNIz4/67UkjaWTUTR+rITyYzuhkSR8b94o04ouKistnqSmXBk/A==",
        "X-Received": "by 2002:a63:e516:: with SMTP id\n\tr22mr2807036pgh.197.1632472719811; \n\tFri, 24 Sep 2021 01:38:39 -0700 (PDT)",
        "From": "Vedant Paranjape <vedantparanjape160201@gmail.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 24 Sep 2021 14:08:21 +0530",
        "Message-Id": "<20210924083821.1877829-1-vedantparanjape160201@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4] test: gstreamer: Add a test for\n\tgstreamer multi stream",
        "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": "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": "This patch adds a test to test if multi stream using libcamera's\ngstreamer element works.\n\nTest will run only on devices that support multistream capture, eg.,\ndevices that use IPU3 and raspberrypi pipeline. This was tested on\na Raspberry Pi 4B+.\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n---\n .../gstreamer/gstreamer_multi_stream_test.cpp | 124 ++++++++++++++++++\n test/gstreamer/meson.build                    |   1 +\n 2 files changed, 125 insertions(+)\n create mode 100644 test/gstreamer/gstreamer_multi_stream_test.cpp",
    "diff": "diff --git a/test/gstreamer/gstreamer_multi_stream_test.cpp b/test/gstreamer/gstreamer_multi_stream_test.cpp\nnew file mode 100644\nindex 000000000000..6a9a6f2509cb\n--- /dev/null\n+++ b/test/gstreamer/gstreamer_multi_stream_test.cpp\n@@ -0,0 +1,124 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/*\n+ * Copyright (C) 2021, Vedant Paranjape\n+ *\n+ * gstreamer_multi_stream_test.cpp - GStreamer multi stream capture test\n+ */\n+\n+#include <iostream>\n+#include <unistd.h>\n+\n+#include <libcamera/libcamera.h>\n+\n+#include <gst/gst.h>\n+\n+#include \"gstreamer_test.h\"\n+#include \"test.h\"\n+\n+using namespace std;\n+\n+class GstreamerMultiStreamTest : public GstreamerTest, public Test\n+{\n+public:\n+\tGstreamerMultiStreamTest()\n+\t\t: GstreamerTest()\n+\t{\n+\t}\n+\n+protected:\n+\tint init() override\n+\t{\n+\t\tif (status_ != TestPass)\n+\t\t\treturn status_;\n+\n+\t\t/* Check if platform support multistream output */\n+\t\tlibcamera::CameraManager cm;\n+\t\tcm.start();\n+\t\tbool cameraFound = false;\n+\t\tfor (auto &camera : cm.cameras()) {\n+\t\t\tif (camera->streams().size() > 1) {\n+\t\t\t\tcameraName_ = camera->id();\n+\t\t\t\tcameraFound = true;\n+\t\t\t\tcm.stop();\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!cameraFound) {\n+\t\t\tcm.stop();\n+\t\t\treturn TestSkip;\n+\t\t}\n+\n+\t\tconst gchar *streamDescription = \"queue ! fakesink\";\n+\t\tg_autoptr(GError) error = NULL;\n+\n+\t\tstream0_ = gst_parse_bin_from_description_full(streamDescription, TRUE,\n+\t\t\t\t\t\t\t       NULL,\n+\t\t\t\t\t\t\t       GST_PARSE_FLAG_FATAL_ERRORS,\n+\t\t\t\t\t\t\t       &error);\n+\t\tif (!stream0_) {\n+\t\t\tg_printerr(\"Stream0 could not be created (%s)\\n\", error->message);\n+\t\t\treturn TestFail;\n+\t\t}\n+\t\tg_object_ref_sink(stream0_);\n+\n+\t\tstream1_ = gst_parse_bin_from_description_full(streamDescription, TRUE,\n+\t\t\t\t\t\t\t       NULL,\n+\t\t\t\t\t\t\t       GST_PARSE_FLAG_FATAL_ERRORS,\n+\t\t\t\t\t\t\t       &error);\n+\t\tif (!stream1_) {\n+\t\t\tg_printerr(\"Stream1 could not be created (%s)\\n\", error->message);\n+\t\t\treturn TestFail;\n+\t\t}\n+\t\tg_object_ref_sink(stream1_);\n+\n+\t\tif (createPipeline() != TestPass)\n+\t\t\treturn TestFail;\n+\n+\t\treturn TestPass;\n+\t}\n+\n+\tint run() override\n+\t{\n+\t\tg_object_set(libcameraSrc_, \"camera-name\", cameraName_.c_str(), NULL);\n+\n+\t\t/* Build the pipeline */\n+\t\tgst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_,\n+\t\t\t\t stream0_, stream1_, NULL);\n+\n+\t\tg_autoptr(GstPad) src_pad = gst_element_get_static_pad(libcameraSrc_, \"src\");\n+\t\tg_autoptr(GstPad) request_pad = gst_element_get_request_pad(libcameraSrc_, \"src_%u\");\n+\n+\t\t{\n+\t\t\tg_autoptr(GstPad) queue0_sink_pad = gst_element_get_static_pad(stream0_, \"sink\");\n+\t\t\tg_autoptr(GstPad) queue1_sink_pad = gst_element_get_static_pad(stream1_, \"sink\");\n+\n+\t\t\tif (gst_pad_link(src_pad, queue0_sink_pad) != GST_PAD_LINK_OK ||\n+\t\t\t    gst_pad_link(request_pad, queue1_sink_pad) != GST_PAD_LINK_OK) {\n+\t\t\t\tg_printerr(\"Pads could not be linked.\\n\");\n+\t\t\t\treturn TestFail;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (startPipeline() != TestPass)\n+\t\t\treturn TestFail;\n+\n+\t\tif (processEvent() != TestPass)\n+\t\t\treturn TestFail;\n+\n+\t\treturn TestPass;\n+\t}\n+\n+\tvoid cleanup() override\n+\t{\n+\t\tg_clear_object(&stream0_);\n+\t\tg_clear_object(&stream1_);\n+\t}\n+\n+private:\n+\tstd::string cameraName_;\n+\tGstElement *stream0_;\n+\tGstElement *stream1_;\n+};\n+\n+TEST_REGISTER(GstreamerMultiStreamTest)\ndiff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build\nindex aca53b920365..10058fc5206f 100644\n--- a/test/gstreamer/meson.build\n+++ b/test/gstreamer/meson.build\n@@ -6,6 +6,7 @@ endif\n \n gstreamer_tests = [\n     ['single_stream_test',   'gstreamer_single_stream_test.cpp'],\n+    ['multi_stream_test',    'gstreamer_multi_stream_test.cpp'],\n ]\n gstreamer_dep = dependency('gstreamer-1.0', required: true)\n \n",
    "prefixes": [
        "libcamera-devel",
        "v4"
    ]
}