1 /* GStreamer
2 *
3 * Copyright (C) 2019 Matthew Waters <matthew@centricular.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #include <gst/gst.h>
27 #include <gst/gl/gl.h>
28 #include <gst/check/gstcheck.h>
29 #include <gst/check/gstharness.h>
30
GST_START_TEST(test_glstereosplit_negotiate)31 GST_START_TEST (test_glstereosplit_negotiate)
32 {
33 GstHarness *mix;
34 GstBuffer *buf;
35
36 mix =
37 gst_harness_new_parse ("gltestsrc num-buffers=1 ! "
38 "glviewconvert output-mode-override=side-by-side ! "
39 "glstereosplit name=s glstereomix name=m s.left ! m. s.right ! m.");
40 gst_harness_use_systemclock (mix);
41 gst_harness_set_blocking_push_mode (mix);
42 gst_harness_set_sink_caps_str (mix,
43 "video/x-raw(memory:GLMemory),format=RGBA,width=1,height=1,"
44 "framerate=30/1,texture-target=2D");
45
46 gst_harness_play (mix);
47 buf = gst_harness_pull (mix);
48 fail_unless (buf != NULL);
49 gst_clear_buffer (&buf);
50
51 gst_harness_teardown (mix);
52 }
53
54 GST_END_TEST;
55
56 static Suite *
glstereo_suite(void)57 glstereo_suite (void)
58 {
59 Suite *s = suite_create ("glstereo");
60 TCase *tc = tcase_create ("general");
61
62 tcase_add_test (tc, test_glstereosplit_negotiate);
63 suite_add_tcase (s, tc);
64
65 return s;
66 }
67
68 int
main(int argc,char ** argv)69 main (int argc, char **argv)
70 {
71 Suite *s;
72 g_setenv ("GST_GL_XINITTHREADS", "1", TRUE);
73 gst_check_init (&argc, &argv);
74 s = glstereo_suite ();
75 return gst_check_run_suite (s, "glstereo", __FILE__);
76 }
77