summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-03-17 16:31:52 +1100
committerMatthew Waters <matthew@centricular.com>2016-03-17 16:34:05 +1100
commit0703c044149cc259ae6fcd910e77dcf456182129 (patch)
tree1bdc44eef3c8bf947ded704e7940d27497186ef2 /tests
parent74bbd4c1aa2e36a7fd260969585be4226e18fac2 (diff)
gl/examples/gtk: call XInitThreads
Fixes some sporadic X11 threading assertions.
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/gl/gtk/filtervideooverlay/Makefile.am4
-rw-r--r--tests/examples/gl/gtk/filtervideooverlay/main.cpp11
-rw-r--r--tests/examples/gl/gtk/fxtest/Makefile.am8
-rw-r--r--tests/examples/gl/gtk/fxtest/fxtest.c8
-rw-r--r--tests/examples/gl/gtk/fxtest/pixbufdrop.c10
-rw-r--r--tests/examples/gl/gtk/gtkvideooverlay/Makefile.am4
-rw-r--r--tests/examples/gl/gtk/gtkvideooverlay/main.cpp12
7 files changed, 48 insertions, 9 deletions
diff --git a/tests/examples/gl/gtk/filtervideooverlay/Makefile.am b/tests/examples/gl/gtk/filtervideooverlay/Makefile.am
index 2bf658b0f..301b2aae6 100644
--- a/tests/examples/gl/gtk/filtervideooverlay/Makefile.am
+++ b/tests/examples/gl/gtk/filtervideooverlay/Makefile.am
@@ -4,8 +4,8 @@ filtervideooverlay_SOURCES = main.cpp
filtervideooverlay_CXXFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) \
- $(GL_CFLAGS) $(GTK3_CFLAGS)
+ $(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
filtervideooverlay_LDADD=../libgstgtkhelper.la \
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
- $(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
+ $(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
diff --git a/tests/examples/gl/gtk/filtervideooverlay/main.cpp b/tests/examples/gl/gtk/filtervideooverlay/main.cpp
index 5a5c9f52b..6850a7da2 100644
--- a/tests/examples/gl/gtk/filtervideooverlay/main.cpp
+++ b/tests/examples/gl/gtk/filtervideooverlay/main.cpp
@@ -18,12 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <gst/gst.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include "../gstgtk.h"
+#ifdef HAVE_X11
+#include <X11/Xlib.h>
+#endif
static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget)
{
@@ -149,6 +156,10 @@ static gchar* slider_fps_cb (GtkScale* scale, gdouble value, GstElement* pipelin
gint main (gint argc, gchar *argv[])
{
+#ifdef HAVE_X11
+ XInitThreads ();
+#endif
+
gtk_init (&argc, &argv);
gst_init (&argc, &argv);
diff --git a/tests/examples/gl/gtk/fxtest/Makefile.am b/tests/examples/gl/gtk/fxtest/Makefile.am
index de052afc1..e078906f5 100644
--- a/tests/examples/gl/gtk/fxtest/Makefile.am
+++ b/tests/examples/gl/gtk/fxtest/Makefile.am
@@ -5,16 +5,16 @@ fxtest_SOURCES = fxtest.c
fxtest_CFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
- $(GL_CFLAGS) $(GTK3_CFLAGS)
+ $(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
fxtest_LDADD=../libgstgtkhelper.la \
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
- $(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
+ $(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
pixbufdrop_SOURCES = pixbufdrop.c
pixbufdrop_CFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
- $(GL_CFLAGS) $(GTK3_CFLAGS)
+ $(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
pixbufdrop_LDADD=../libgstgtkhelper.la \
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
- $(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
+ $(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
diff --git a/tests/examples/gl/gtk/fxtest/fxtest.c b/tests/examples/gl/gtk/fxtest/fxtest.c
index c1cddeace..6200659a0 100644
--- a/tests/examples/gl/gtk/fxtest/fxtest.c
+++ b/tests/examples/gl/gtk/fxtest/fxtest.c
@@ -32,6 +32,10 @@
#include <gst/video/videooverlay.h>
+#ifdef HAVE_X11
+#include <X11/Xlib.h>
+#endif
+
static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, GtkWidget * widget)
@@ -179,6 +183,10 @@ main (gint argc, gchar * argv[])
GstBus *bus;
GError *error = NULL;
+#ifdef HAVE_X11
+ XInitThreads ();
+#endif
+
GtkWidget *window;
GtkWidget *screen;
GtkWidget *vbox, *combo;
diff --git a/tests/examples/gl/gtk/fxtest/pixbufdrop.c b/tests/examples/gl/gtk/fxtest/pixbufdrop.c
index 69bf3af34..3a43de2e0 100644
--- a/tests/examples/gl/gtk/fxtest/pixbufdrop.c
+++ b/tests/examples/gl/gtk/fxtest/pixbufdrop.c
@@ -32,6 +32,10 @@
#include <gst/video/videooverlay.h>
+#ifdef HAVE_X11
+#include <X11/Xlib.h>
+#endif
+
static gint delay = 0;
static gint saveddelay = 0;
static gint method = 1;
@@ -200,6 +204,10 @@ main (gint argc, gchar * argv[])
{NULL}
};
+#ifdef HAVE_X11
+ XInitThreads ();
+#endif
+
context = g_option_context_new (NULL);
g_option_context_add_main_entries (context, options, NULL);
g_option_context_add_group (context, gst_init_get_option_group ());
@@ -219,7 +227,7 @@ main (gint argc, gchar * argv[])
if (source_desc == NULL) {
source_desc =
g_strdup
- ("videotestsrc ! video/x-raw, width=352, height=288 ! identity");
+ ("videotestsrc ! video/x-raw, width=352, height=288 ! identity ! glupload");
}
sourcebin =
diff --git a/tests/examples/gl/gtk/gtkvideooverlay/Makefile.am b/tests/examples/gl/gtk/gtkvideooverlay/Makefile.am
index bab0e5bf8..d6da10dc5 100644
--- a/tests/examples/gl/gtk/gtkvideooverlay/Makefile.am
+++ b/tests/examples/gl/gtk/gtkvideooverlay/Makefile.am
@@ -4,8 +4,8 @@ gtkvideooverlay_SOURCES = main.cpp
gtkvideooverlay_CXXFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) \
- $(GL_CFLAGS) $(GTK3_CFLAGS)
+ $(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
gtkvideooverlay_LDADD=../libgstgtkhelper.la \
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
- $(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
+ $(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
diff --git a/tests/examples/gl/gtk/gtkvideooverlay/main.cpp b/tests/examples/gl/gtk/gtkvideooverlay/main.cpp
index 8d886b5c2..5ca810831 100644
--- a/tests/examples/gl/gtk/gtkvideooverlay/main.cpp
+++ b/tests/examples/gl/gtk/gtkvideooverlay/main.cpp
@@ -18,12 +18,20 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <gst/gst.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include "../gstgtk.h"
+#ifdef HAVE_X11
+#include <X11/Xlib.h>
+#endif
+
static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget)
{
@@ -140,6 +148,10 @@ static gchar* slider_fps_cb (GtkScale* scale, gdouble value, GstElement* pipelin
gint main (gint argc, gchar *argv[])
{
+#ifdef HAVE_X11
+ XInitThreads ();
+#endif
+
GtkWidget *area;
gst_init (&argc, &argv);
gtk_init (&argc, &argv);