From 4a7a247293d197eaab3150c59dd2ea2a5d6c728a Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 21 Apr 2020 20:09:41 +1000 Subject: [PATCH] tests: add glviewconvert users integration unit test Catch all smoke test for ensuring a basic pipeline can negotiate successfully. Part-of: --- tests/check/elements/glstereo.c | 76 +++++++++++++++++++++++++++++++++ tests/check/meson.build | 1 + 2 files changed, 77 insertions(+) create mode 100644 tests/check/elements/glstereo.c diff --git a/tests/check/elements/glstereo.c b/tests/check/elements/glstereo.c new file mode 100644 index 0000000000..fbf568e590 --- /dev/null +++ b/tests/check/elements/glstereo.c @@ -0,0 +1,76 @@ +/* GStreamer + * + * Copyright (C) 2019 Matthew Waters + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +GST_START_TEST (test_glstereosplit_negotiate) +{ + GstHarness *mix; + GstBuffer *buf; + + mix = + gst_harness_new_parse ("gltestsrc num-buffers=1 ! " + "glviewconvert output-mode-override=side-by-side ! " + "glstereosplit name=s glstereomix name=m s.left ! m. s.right ! m."); + gst_harness_use_systemclock (mix); + gst_harness_set_blocking_push_mode (mix); + gst_harness_set_sink_caps_str (mix, + "video/x-raw(memory:GLMemory),format=RGBA,width=1,height=1," + "framerate=30/1,texture-target=2D"); + + gst_harness_play (mix); + buf = gst_harness_pull (mix); + fail_unless (buf != NULL); + gst_clear_buffer (&buf); + + gst_harness_teardown (mix); +} + +GST_END_TEST; + +static Suite * +glstereo_suite (void) +{ + Suite *s = suite_create ("glstereo"); + TCase *tc = tcase_create ("general"); + + tcase_add_test (tc, test_glstereosplit_negotiate); + suite_add_tcase (s, tc); + + return s; +} + +int +main (int argc, char **argv) +{ + Suite *s; + g_setenv ("GST_GL_XINITTHREADS", "1", TRUE); + gst_check_init (&argc, &argv); + s = glstereo_suite (); + return gst_check_run_suite (s, "glstereo", __FILE__); +} diff --git a/tests/check/meson.build b/tests/check/meson.build index cc064f3471..3d267febf6 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -101,6 +101,7 @@ if build_gstgl and host_machine.system() != 'windows' [ 'elements/glbin.c', not build_gstgl ], [ 'pipelines/gl-launch-lines.c', not build_gstgl ], [ 'elements/glfilter.c', not build_gstgl, [gstgl_dep]], + [ 'elements/glstereo.c', not build_gstgl, [gstgl_dep]], ] endif