{"id":13576,"url":"https://patchwork.libcamera.org/api/1.1/patches/13576/?format=json","web_url":"https://patchwork.libcamera.org/patch/13576/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210831063735.1136615-1-vedantparanjape160201@gmail.com>","date":"2021-08-31T06:37:35","name":"[libcamera-devel,v2] test: gstreamer: Factor out code into a base class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"05d312497c23985c32781c24cae84ff14a2ed195","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/1.1/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13576/mbox/","series":[{"id":2424,"url":"https://patchwork.libcamera.org/api/1.1/series/2424/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2424","date":"2021-08-31T06:37:35","name":"[libcamera-devel,v2] test: gstreamer: Factor out code into a base class","version":2,"mbox":"https://patchwork.libcamera.org/series/2424/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13576/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13576/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 ED469BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 Aug 2021 06:37:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EBADE6916C;\n\tTue, 31 Aug 2021 08:37:55 +0200 (CEST)","from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com\n\t[IPv6:2607:f8b0:4864:20::1034])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ACA0260137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 08:37:54 +0200 (CEST)","by mail-pj1-x1034.google.com with SMTP id\n\tw19-20020a17090aaf9300b00191e6d10a19so1650645pjq.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Aug 2021 23:37:54 -0700 (PDT)","from localhost.localdomain ([1.186.166.49])\n\tby smtp.googlemail.com with ESMTPSA id\n\t15sm16471953pfu.192.2021.08.30.23.37.51\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 30 Aug 2021 23:37:52 -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=\"rzPLiHVd\"; 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=WGwhmIAeS9gkcZHkT5XlnMeLbyr2jxs5D/XxZQ20z44=;\n\tb=rzPLiHVdEVttPSBPlNkXJsA8UdY2HXk166qEoV+klJTwAddBB/lGS67oC6q/YkQ8Ib\n\t0JVLwTeUy4B4A3VdOH2PFCqt2vLBRRMpbAIMfqF3TBcRS051mvHI6bew2okDW2zkSJUM\n\tCGVPUF3ALy9VLNhLOFFfxjUrkVBZJdwXLinkhD+gm9Aw+9xf4WjNIPLn2DSl9v/qUxNg\n\ttZt3S5h9UGBK1W9GA6LOAQrm+KWwm2e32H6sG2Vu24H/DfsuDeGV/pnGG1CRXTb5l/iS\n\t8GCD6Cn1Z6cpvvIieBxVyNZr6VbZdqTxJuChOO67lUq5L169PI4DFCbj5hDc4HOUFLnM\n\tt+LQ==","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=WGwhmIAeS9gkcZHkT5XlnMeLbyr2jxs5D/XxZQ20z44=;\n\tb=UzGK1RcXjEViyo/2JkU/6HzVm+hyAX8SZAJ45xIloA70VuGjiicX4cv/AA8QsuQAYj\n\t86Ied9NApr0WoirvsjWuqiM0NzwajCxmJyHkcg2LkUJ3eJQcQz1bpTFXW8ufsWtHTZip\n\tuuWhiCe1y50oBykvVVISD2DFn+1sxf2uN/CJ21Z9gOPS9Sj7F41GKrL/foIK+L6b2uxb\n\tjcWx1RzQhdYbM09XlR95p2tEPS8WHrKZoEPSIugEdo7Y0JItTsDY3hok3ykvrbZvEIZt\n\tT29YY3T03TGzA6hZKVI6JC+DuEiAV+68aJmGd40kbZhsfNnjlVmPp6+v03V148Q5S9Ch\n\tTQQg==","X-Gm-Message-State":"AOAM532me+4yVIosd2lMwBA4z1LGsFNuRBcSmZdn3tCGE3pY1LIMRZWS\n\t5Fbonvg2A9cVd4v0A2fMTSZ+YNxw6XT2NGACliw=","X-Google-Smtp-Source":"ABdhPJySxvD5vMu/21J9JlIlbSxEtHnl2M1Y+qbzx3iJxnryLxMH3FaLSMn+VgN5v0nkYowTF17Ngw==","X-Received":"by 2002:a17:90a:514b:: with SMTP id\n\tk11mr3503154pjm.152.1630391872805; \n\tMon, 30 Aug 2021 23:37:52 -0700 (PDT)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 31 Aug 2021 12:07:35 +0530","Message-Id":"<20210831063735.1136615-1-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] 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          | 145 +++------------\n test/gstreamer/gstreamer_test.cpp             | 165 ++++++++++++++++++\n test/gstreamer/gstreamer_test.h               |  39 +++++\n test/gstreamer/meson.build                    |   2 +-\n 4 files changed, 229 insertions(+), 122 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..c27e4d36 100644\n--- a/test/gstreamer/gstreamer_single_stream_test.cpp\n+++ b/test/gstreamer/gstreamer_single_stream_test.cpp\n@@ -14,104 +14,48 @@\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+\t\tif (status_ != TestPass)\n+\t\t\treturn status_;\n \n-\t\t\treturn TestFail;\n-\t\t}\n+\t\tg_autoptr(GstElement) convert0__ = gst_element_factory_make(\"videoconvert\", \"convert0\");\n+\t\tg_autoptr(GstElement) sink0__ = gst_element_factory_make(\"fakesink\", \"sink0\");\n+\t\tg_object_ref_sink(convert0__);\n+\t\tg_object_ref_sink(sink0__);\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+\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 \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 \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\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+\t\tconvert0_ = reinterpret_cast<GstElement *>(g_steal_pointer(&convert0__));\n+\t\tsink0_ = reinterpret_cast<GstElement *>(g_steal_pointer(&sink0__));\n \n+\t\tif (gstreamer_create_pipeline() != TestPass)\n \t\t\treturn TestFail;\n-\t\t}\n \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 +63,16 @@ 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\tif (gstreamer_start_pipeline() != TestPass)\n \t\t\treturn TestFail;\n-\t\t}\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\tif (gstreamer_process_event() != TestPass)\n+\t\t\treturn TestFail;\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..d9a9618a\n--- /dev/null\n+++ b/test/gstreamer/gstreamer_test.cpp\n@@ -0,0 +1,165 @@\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* Remove the system libcamera plugin, if any, and add the\n+\t* plugin from the build directory.\n+\t*/\n+\tGstRegistry *registry = gst_registry_get();\n+\tg_autoptr(GstPlugin) plugin = gst_registry_lookup(registry, \"libgstlibcamera.so\");\n+\tif (plugin) {\n+\t\tgst_registry_remove_plugin(registry, 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+\n+\t\tstatus_ = TestFail;\n+\t\treturn;\n+\t}\n+\n+\t/* Create the element */\n+\tg_autoptr(GstElement) libcameraSrc__ = gst_element_factory_make(\"libcamerasrc\", \"libcamera\");\n+\tg_object_ref_sink(libcameraSrc__);\n+\n+\tif (!libcameraSrc__) {\n+\t\tg_printerr(\"Unable to create libcamera element\\n\");\n+\n+\t\tstatus_ = TestFail;\n+\t\treturn;\n+\t}\n+\n+\tlibcameraSrc_ = reinterpret_cast<GstElement *>(g_steal_pointer(&libcameraSrc__));\n+\n+\tstatus_ = TestPass;\n+}\n+\n+GstreamerTest::~GstreamerTest()\n+{\n+\tif (pipeline_)\n+\t\tgst_object_unref(pipeline_);\n+\tif (status_ == TestFail) {\n+\t\tgst_object_unref(libcameraSrc_);\n+\t}\n+\n+\tgst_deinit();\n+}\n+\n+int GstreamerTest::gstreamer_create_pipeline()\n+{\n+\tpipeline_ = gst_pipeline_new(\"test-pipeline\");\n+\n+\tif (!pipeline_) {\n+\t\tg_printerr(\"Unable to create pipeline\\n\");\n+\n+\t\treturn TestFail;\n+\t}\n+\n+\treturn TestPass;\n+}:la\n+\n+int 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\treturn TestFail;\n+\t}\n+\n+\treturn TestPass;\n+}\n+\n+int GstreamerTest::gstreamer_process_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\treturn TestPass;\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+\treturn TestFail;\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..cdffdea9\n--- /dev/null\n+++ b/test/gstreamer/gstreamer_test.h\n@@ -0,0 +1,39 @@\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+\tvirtual ~GstreamerTest();\n+\n+protected:\n+\tvirtual int gstreamer_create_pipeline();\n+\tint gstreamer_start_pipeline();\n+\tint gstreamer_process_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__ */\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","v2"]}