Show a patch.

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

{
    "id": 13565,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13565/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13565/",
    "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": "<20210829210632.432207-1-vedantparanjape160201@gmail.com>",
    "date": "2021-08-29T21:06:32",
    "name": "[libcamera-devel,v1] test: gstreamer: Factor out code into a base class",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "90e88acada0825af94d76460d4dcf6e5862cce57",
    "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/13565/mbox/",
    "series": [
        {
            "id": 2419,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2419/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2419",
            "date": "2021-08-29T21:06:32",
            "name": "[libcamera-devel,v1] test: gstreamer: Factor out code into a base class",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2419/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13565/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13565/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 BCA47BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 29 Aug 2021 21:06:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A17D6916C;\n\tSun, 29 Aug 2021 23:06:42 +0200 (CEST)",
            "from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com\n\t[IPv6:2607:f8b0:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EF50C68891\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Aug 2021 23:06:40 +0200 (CEST)",
            "by mail-pf1-x42b.google.com with SMTP id 2so10568290pfo.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Aug 2021 14:06:40 -0700 (PDT)",
            "from localhost.localdomain ([1.186.166.201])\n\tby smtp.googlemail.com with ESMTPSA id\n\tn13sm12106271pff.164.2021.08.29.14.06.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 29 Aug 2021 14:06:38 -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=\"i/dTZyEM\"; 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=Tmf6X8jcvYT13ISt60CwTn13OxJxoNO4cLbySD807mM=;\n\tb=i/dTZyEMUl0LTrW3V7sS40cMzgW8kXsaN2NAhReygL5UqDy+onClLoKkoTOvaq3Pc2\n\ttvgv8ms9blxDMWsriA6BOJMDhK7gef8E2oAq1opNJZaNOm/2scfYpLe2pYerm5VpB1M7\n\tH1RIG3okOZdwx+dtIofLmT4dBirvcr15zLmtw+XZPxEsCYSnLXqerEtHPc69sJspMZjO\n\t+DU5h7CXsqadHjHssW22LMprPn8cyYoJSPkncgxeF/jE67iQH0K0ynavJYea8hVfrJ/I\n\tsAiIBx0Lc8n8shV3Xylv09sZXcV8SujzjT8CKiTGlvtJzIGXiFhmqTHaeGnYcH0ifhrt\n\tZrYQ==",
        "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=Tmf6X8jcvYT13ISt60CwTn13OxJxoNO4cLbySD807mM=;\n\tb=pqUfrxSGk+LTEaEkKM9V1w4HCLhwTinLeza5XcEqBGehdZnbX7ErBMPfNoDqA/+BXV\n\t6DARExlvB20CqUuYXJwS1tGB+lx7F4VYreVepHAaq71DI0Y98z9DF5evmbOziTKi/iF5\n\tLcIbBGvp4mzChTzaukRomxf8WxlHUkUorpsNWq2p2FbdghKZSvTuxxOl/aWF9QLsWrPj\n\tE+SBP34JZcCasF/P5txQEjwQupCnEKjbob8KRqNb0/cT+YHgZskeuNHgUixWw9io7N0W\n\ttQf+CttXSwYts1gRbulliViJ6FFZA2s8689NgypjDKlcmDhCt7MqMoRLXkD5+vdjw0iE\n\tRLrQ==",
        "X-Gm-Message-State": "AOAM531Fn4bLjioOkcJxapJHACOkHz0eXPq7pSgkhdq30acagcX0jdB5\n\t+LQx8oIGxYwVtAe0cGQfUvECjjGbq4wyfw==",
        "X-Google-Smtp-Source": "ABdhPJxvJGBuY+nGSStHjVlSZOweCt4LXUUPYwE4Dlk6qfFaCro/cjUGRN4TTH9jwWHf0j+4DoZDxA==",
        "X-Received": "by 2002:aa7:9f9c:0:b0:3fe:ba:96d1 with SMTP id\n\tz28-20020aa79f9c000000b003fe00ba96d1mr4047619pfr.72.1630271198919; \n\tSun, 29 Aug 2021 14:06:38 -0700 (PDT)",
        "From": "Vedant Paranjape <vedantparanjape160201@gmail.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 30 Aug 2021 02:36:32 +0530",
        "Message-Id": "<20210829210632.432207-1-vedantparanjape160201@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1] test: gstreamer: Factor out code into\n\ta base class",
        "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": "Lot of code used in single stream test is boiler plate and common across\nevery gstreamer test. Factored out this code into a base class called\nGstreamerTest.\n\nAlso updated the gstreamer_single_stream_test to use the GstreamerTest\nbase class\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n .../gstreamer_single_stream_test.cpp          | 138 +++------------\n test/gstreamer/gstreamer_test.cpp             | 157 ++++++++++++++++++\n test/gstreamer/gstreamer_test.h               |  38 +++++\n test/gstreamer/meson.build                    |   2 +-\n 4 files changed, 216 insertions(+), 119 deletions(-)\n create mode 100644 test/gstreamer/gstreamer_test.cpp\n create mode 100644 test/gstreamer/gstreamer_test.h",
    "diff": "diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp\nindex 4c8d4804..021ac269 100644\n--- a/test/gstreamer/gstreamer_single_stream_test.cpp\n+++ b/test/gstreamer/gstreamer_single_stream_test.cpp\n@@ -14,86 +14,35 @@\n \n #include <gst/gst.h>\n \n+#include \"gstreamer_test.h\"\n #include \"test.h\"\n \n using namespace std;\n \n-extern \"C\" {\n-const char *__asan_default_options()\n-{\n-\t/*\n-\t * Disable leak detection due to a known global variable initialization\n-\t * leak in glib's g_quark_init(). This should ideally be handled by\n-\t * using a suppression file instead of disabling leak detection.\n-\t */\n-\treturn \"detect_leaks=false\";\n-}\n-}\n-\n-class GstreamerSingleStreamTest : public Test\n+class GstreamerSingleStreamTest : public GstreamerTest, public Test\n {\n+public:\n+\tGstreamerSingleStreamTest()\n+\t\t: GstreamerTest()\n+\t{\n+\t}\n+\n protected:\n \tint init() override\n \t{\n-\t\t/*\n-\t\t * GStreamer by default spawns a process to run the\n-\t\t * gst-plugin-scanner helper. If libcamera is compiled with ASan\n-\t\t * enabled, and as GStreamer is most likely not, this causes the\n-\t\t * ASan link order check to fail when gst-plugin-scanner\n-\t\t * dlopen()s the plugin as many libraries will have already been\n-\t\t * loaded by then. Fix this issue by disabling spawning of a\n-\t\t * child helper process when scanning the build directory for\n-\t\t * plugins.\n-\t\t */\n-\t\tgst_registry_fork_set_enabled(false);\n-\n-\t\t/* Initialize GStreamer */\n-\t\tg_autoptr(GError) errInit = NULL;\n-\t\tif (!gst_init_check(nullptr, nullptr, &errInit)) {\n-\t\t\tg_printerr(\"Could not initialize GStreamer: %s\\n\",\n-\t\t\t\t   errInit ? errInit->message : \"unknown error\");\n-\n-\t\t\treturn TestFail;\n-\t\t}\n-\n-\t\t/*\n-\t\t * Remove the system libcamera plugin, if any, and add the\n-\t\t * plugin from the build directory.\n-\t\t */\n-\t\tGstRegistry *registry = gst_registry_get();\n-\t\tGstPlugin *plugin = gst_registry_lookup(registry, \"libgstlibcamera.so\");\n-\t\tif (plugin) {\n-\t\t\tgst_registry_remove_plugin(registry, plugin);\n-\t\t\tgst_object_unref(plugin);\n-\t\t}\n-\n-\t\tstd::string path = libcamera::utils::libcameraBuildPath()\n-\t\t\t\t + \"src/gstreamer\";\n-\t\tif (!gst_registry_scan_path(registry, path.c_str())) {\n-\t\t\tg_printerr(\"Failed to add plugin to registry\\n\");\n-\t\t\tgst_deinit();\n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tif (status_ != TestPass)\n+\t\t\treturn status_;\n \n-\t\t/* Create the elements */\n-\t\tlibcameraSrc_ = gst_element_factory_make(\"libcamerasrc\", \"libcamera\");\n \t\tconvert0_ = gst_element_factory_make(\"videoconvert\", \"convert0\");\n \t\tsink0_ = gst_element_factory_make(\"fakesink\", \"sink0\");\n \n-\t\t/* Create the empty pipeline_ */\n-\t\tpipeline_ = gst_pipeline_new(\"test-pipeline\");\n-\n-\t\tif (!pipeline_ || !convert0_ || !sink0_ || !libcameraSrc_) {\n-\t\t\tg_printerr(\"Not all elements could be created. %p.%p.%p.%p\\n\",\n-\t\t\t\t   pipeline_, convert0_, sink0_, libcameraSrc_);\n-\t\t\tif (pipeline_)\n-\t\t\t\tgst_object_unref(pipeline_);\n+\t\tif (!convert0_ || !sink0_) {\n+\t\t\tg_printerr(\"Not all elements could be created. %p.%p\\n\",\n+\t\t\t\t   convert0_, sink0_);\n \t\t\tif (convert0_)\n \t\t\t\tgst_object_unref(convert0_);\n \t\t\tif (sink0_)\n \t\t\t\tgst_object_unref(sink0_);\n-\t\t\tif (libcameraSrc_)\n-\t\t\t\tgst_object_unref(libcameraSrc_);\n \t\t\tgst_deinit();\n \n \t\t\treturn TestFail;\n@@ -102,16 +51,8 @@ protected:\n \t\treturn TestPass;\n \t}\n \n-\tvoid cleanup() override\n-\t{\n-\t\tgst_object_unref(pipeline_);\n-\t\tgst_deinit();\n-\t}\n-\n \tint run() override\n \t{\n-\t\tGstStateChangeReturn ret;\n-\n \t\t/* Build the pipeline */\n \t\tgst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_, convert0_, sink0_, NULL);\n \t\tif (gst_element_link_many(libcameraSrc_, convert0_, sink0_, NULL) != TRUE) {\n@@ -119,57 +60,18 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\t/* Start playing */\n-\t\tret = gst_element_set_state(pipeline_, GST_STATE_PLAYING);\n-\t\tif (ret == GST_STATE_CHANGE_FAILURE) {\n-\t\t\tg_printerr(\"Unable to set the pipeline to the playing state.\\n\");\n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tgstreamer_start_pipeline();\n+\t\tif (status_ != TestPass)\n+\t\t\treturn status_;\n \n-\t\t/* Wait until error or EOS or timeout after 2 seconds */\n-\t\tconstexpr GstMessageType msgType =\n-\t\t\tstatic_cast<GstMessageType>(GST_MESSAGE_ERROR | GST_MESSAGE_EOS);\n-\t\tconstexpr GstClockTime timeout = 2 * GST_SECOND;\n-\n-\t\tg_autoptr(GstBus) bus = gst_element_get_bus(pipeline_);\n-\t\tg_autoptr(GstMessage) msg = gst_bus_timed_pop_filtered(bus, timeout, msgType);\n-\n-\t\tgst_element_set_state(pipeline_, GST_STATE_NULL);\n-\n-\t\t/* Parse error message */\n-\t\tif (msg == NULL)\n-\t\t\treturn TestPass;\n-\n-\t\tswitch (GST_MESSAGE_TYPE(msg)) {\n-\t\tcase GST_MESSAGE_ERROR:\n-\t\t\tgstreamer_print_error(msg);\n-\t\t\tbreak;\n-\t\tcase GST_MESSAGE_EOS:\n-\t\t\tg_print(\"End-Of-Stream reached.\\n\");\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tg_printerr(\"Unexpected message received.\\n\");\n-\t\t\tbreak;\n-\t\t}\n+\t\tgstreamer_wait_for_event();\n+\t\tif (status_ != TestPass)\n+\t\t\treturn status_;\n \n-\t\treturn TestFail;\n+\t\treturn TestPass;\n \t}\n \n private:\n-\tvoid gstreamer_print_error(GstMessage *msg)\n-\t{\n-\t\tg_autoptr(GError) err = NULL;\n-\t\tg_autofree gchar *debug_info = NULL;\n-\n-\t\tgst_message_parse_error(msg, &err, &debug_info);\n-\t\tg_printerr(\"Error received from element %s: %s\\n\",\n-\t\t\t   GST_OBJECT_NAME(msg->src), err->message);\n-\t\tg_printerr(\"Debugging information: %s\\n\",\n-\t\t\t   debug_info ? debug_info : \"none\");\n-\t}\n-\n-\tGstElement *pipeline_;\n-\tGstElement *libcameraSrc_;\n \tGstElement *convert0_;\n \tGstElement *sink0_;\n };\ndiff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\nnew file mode 100644\nindex 00000000..34608a02\n--- /dev/null\n+++ b/test/gstreamer/gstreamer_test.cpp\n@@ -0,0 +1,157 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/*\n+ * Copyright (C) 2021, Vedant Paranjape\n+ *\n+ * libcamera Gstreamer element API tests\n+ */\n+\n+#include \"gstreamer_test.h\"\n+\n+#include \"test.h\"\n+\n+using namespace std;\n+\n+extern \"C\" {\n+const char *__asan_default_options()\n+{\n+\t/*\n+\t * Disable leak detection due to a known global variable initialization\n+\t * leak in glib's g_quark_init(). This should ideally be handled by\n+\t * using a suppression file instead of disabling leak detection.\n+\t */\n+\treturn \"detect_leaks=false\";\n+}\n+}\n+\n+GstreamerTest::GstreamerTest()\n+{\n+\t/*\n+\t* GStreamer by default spawns a process to run the\n+\t* gst-plugin-scanner helper. If libcamera is compiled with ASan\n+\t* enabled, and as GStreamer is most likely not, this causes the\n+\t* ASan link order check to fail when gst-plugin-scanner\n+\t* dlopen()s the plugin as many libraries will have already been\n+\t* loaded by then. Fix this issue by disabling spawning of a\n+\t* child helper process when scanning the build directory for\n+\t* plugins.\n+\t*/\n+\tgst_registry_fork_set_enabled(false);\n+\n+\t/* Initialize GStreamer */\n+\tg_autoptr(GError) errInit = NULL;\n+\tif (!gst_init_check(nullptr, nullptr, &errInit)) {\n+\t\tg_printerr(\"Could not initialize GStreamer: %s\\n\",\n+\t\t\t   errInit ? errInit->message : \"unknown error\");\n+\n+\t\tstatus_ = TestFail;\n+\t\treturn;\n+\t}\n+\n+\t/*\n+\t\t* Remove the system libcamera plugin, if any, and add the\n+\t\t* plugin from the build directory.\n+\t\t*/\n+\tGstRegistry *registry = gst_registry_get();\n+\tGstPlugin *plugin = gst_registry_lookup(registry, \"libgstlibcamera.so\");\n+\tif (plugin) {\n+\t\tgst_registry_remove_plugin(registry, plugin);\n+\t\tgst_object_unref(plugin);\n+\t}\n+\n+\tstd::string path = libcamera::utils::libcameraBuildPath() + \"src/gstreamer\";\n+\tif (!gst_registry_scan_path(registry, path.c_str())) {\n+\t\tg_printerr(\"Failed to add plugin to registry\\n\");\n+\t\tgst_deinit();\n+\t\tstatus_ = TestFail;\n+\t\treturn;\n+\t}\n+\n+\t/* Create the elements */\n+\tlibcameraSrc_ = gst_element_factory_make(\"libcamerasrc\", \"libcamera\");\n+\tpipeline_ = gst_pipeline_new(\"test-pipeline\");\n+\n+\tif (!pipeline_ || !libcameraSrc_) {\n+\t\tg_printerr(\"Not all elements could be created. %p.%p\\n\",\n+\t\t\t   pipeline_, libcameraSrc_);\n+\t\tif (pipeline_)\n+\t\t\tgst_object_unref(pipeline_);\n+\t\tif (libcameraSrc_)\n+\t\t\tgst_object_unref(libcameraSrc_);\n+\t\tgst_deinit();\n+\t\tstatus_ = TestFail;\n+\t\treturn;\n+\t}\n+\n+\tstatus_ = TestPass;\n+}\n+\n+GstreamerTest::~GstreamerTest()\n+{\n+\tgst_object_unref(pipeline_);\n+\tif (status_ == TestFail) {\n+\t\tgst_object_unref(libcameraSrc_);\n+\t}\n+\n+\tgst_deinit();\n+}\n+\n+void GstreamerTest::gstreamer_start_pipeline()\n+{\n+\tGstStateChangeReturn ret;\n+\n+\t/* Start playing */\n+\tret = gst_element_set_state(pipeline_, GST_STATE_PLAYING);\n+\tif (ret == GST_STATE_CHANGE_FAILURE) {\n+\t\tg_printerr(\"Unable to set the pipeline to the playing state.\\n\");\n+\t\tstatus_ = TestFail;\n+\t\treturn;\n+\t}\n+\n+\tstatus_ = TestPass;\n+}\n+\n+void GstreamerTest::gstreamer_wait_for_event()\n+{\n+\t/* Wait until error or EOS or timeout after 2 seconds */\n+\tconstexpr GstMessageType msgType =\n+\t\tstatic_cast<GstMessageType>(GST_MESSAGE_ERROR | GST_MESSAGE_EOS);\n+\tconstexpr GstClockTime timeout = 2 * GST_SECOND;\n+\n+\tg_autoptr(GstBus) bus = gst_element_get_bus(pipeline_);\n+\tg_autoptr(GstMessage) msg = gst_bus_timed_pop_filtered(bus, timeout, msgType);\n+\n+\tgst_element_set_state(pipeline_, GST_STATE_NULL);\n+\n+\t/* Parse error message */\n+\tif (msg == NULL) {\n+\t\tstatus_ = TestPass;\n+\t\treturn;\n+\t}\n+\n+\tswitch (GST_MESSAGE_TYPE(msg)) {\n+\tcase GST_MESSAGE_ERROR:\n+\t\tgstreamer_print_error(msg);\n+\t\tbreak;\n+\tcase GST_MESSAGE_EOS:\n+\t\tg_print(\"End-Of-Stream reached.\\n\");\n+\t\tbreak;\n+\tdefault:\n+\t\tg_printerr(\"Unexpected message received.\\n\");\n+\t\tbreak;\n+\t}\n+\n+\tstatus_ = TestPass;\n+}\n+\n+void GstreamerTest::gstreamer_print_error(GstMessage *msg)\n+{\n+\tg_autoptr(GError) err = NULL;\n+\tg_autofree gchar *debug_info = NULL;\n+\n+\tgst_message_parse_error(msg, &err, &debug_info);\n+\tg_printerr(\"Error received from element %s: %s\\n\",\n+\t\t   GST_OBJECT_NAME(msg->src), err->message);\n+\tg_printerr(\"Debugging information: %s\\n\",\n+\t\t   debug_info ? debug_info : \"none\");\n+}\n+\ndiff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h\nnew file mode 100644\nindex 00000000..8e117166\n--- /dev/null\n+++ b/test/gstreamer/gstreamer_test.h\n@@ -0,0 +1,38 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/*\n+ * Copyright (C) 2021, Vedant Paranjape\n+ *\n+ * gstreamer_test.cpp - GStreamer test base class\n+ */\n+\n+#ifndef __LIBCAMERA_GSTREAMER_TEST_H__\n+#define __LIBCAMERA_GSTREAMER_TEST_H__\n+\n+#include <iostream>\n+#include <unistd.h>\n+\n+#include <libcamera/base/utils.h>\n+\n+#include \"libcamera/internal/source_paths.h\"\n+\n+#include <gst/gst.h>\n+\n+using namespace std;\n+\n+class GstreamerTest\n+{\n+public:\n+\tGstreamerTest();\n+\t~GstreamerTest();\n+\n+protected:\n+\tvoid gstreamer_start_pipeline();\n+\tvoid gstreamer_wait_for_event();\n+\tvoid gstreamer_print_error(GstMessage *msg);\n+\n+\tGstElement *pipeline_;\n+\tGstElement *libcameraSrc_;\n+\tint status_;\n+};\n+\n+#endif /* __LIBCAMERA_GSTREAMER_TEST_H__ */\n\\ No newline at end of file\ndiff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build\nindex b99aa0da..aca53b92 100644\n--- a/test/gstreamer/meson.build\n+++ b/test/gstreamer/meson.build\n@@ -10,7 +10,7 @@ gstreamer_tests = [\n gstreamer_dep = dependency('gstreamer-1.0', required: true)\n \n foreach t : gstreamer_tests\n-    exe = executable(t[0], t[1],\n+    exe = executable(t[0], t[1], 'gstreamer_test.cpp',\n                      dependencies : [libcamera_private, gstreamer_dep],\n                      link_with : test_libraries,\n                      include_directories : test_includes_internal)\n",
    "prefixes": [
        "libcamera-devel",
        "v1"
    ]
}