mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
gl/examples/gtk: call XInitThreads
Fixes some sporadic X11 threading assertions.
This commit is contained in:
parent
2ba61c9049
commit
d2542993dd
7 changed files with 48 additions and 9 deletions
|
@ -4,8 +4,8 @@ filtervideooverlay_SOURCES = main.cpp
|
||||||
|
|
||||||
filtervideooverlay_CXXFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
filtervideooverlay_CXXFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) \
|
||||||
$(GL_CFLAGS) $(GTK3_CFLAGS)
|
$(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
|
||||||
filtervideooverlay_LDADD=../libgstgtkhelper.la \
|
filtervideooverlay_LDADD=../libgstgtkhelper.la \
|
||||||
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
||||||
$(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
|
$(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,19 @@
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
|
|
||||||
#include "../gstgtk.h"
|
#include "../gstgtk.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget)
|
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[])
|
gint main (gint argc, gchar *argv[])
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
XInitThreads ();
|
||||||
|
#endif
|
||||||
|
|
||||||
gtk_init (&argc, &argv);
|
gtk_init (&argc, &argv);
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,16 @@ fxtest_SOURCES = fxtest.c
|
||||||
|
|
||||||
fxtest_CFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
fxtest_CFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
||||||
$(GL_CFLAGS) $(GTK3_CFLAGS)
|
$(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
|
||||||
fxtest_LDADD=../libgstgtkhelper.la \
|
fxtest_LDADD=../libgstgtkhelper.la \
|
||||||
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
$(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_SOURCES = pixbufdrop.c
|
||||||
|
|
||||||
pixbufdrop_CFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
pixbufdrop_CFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
||||||
$(GL_CFLAGS) $(GTK3_CFLAGS)
|
$(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
|
||||||
pixbufdrop_LDADD=../libgstgtkhelper.la \
|
pixbufdrop_LDADD=../libgstgtkhelper.la \
|
||||||
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
||||||
$(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
|
$(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <gst/video/videooverlay.h>
|
#include <gst/video/videooverlay.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static GstBusSyncReply
|
static GstBusSyncReply
|
||||||
create_window (GstBus * bus, GstMessage * message, GtkWidget * widget)
|
create_window (GstBus * bus, GstMessage * message, GtkWidget * widget)
|
||||||
|
@ -179,6 +183,10 @@ main (gint argc, gchar * argv[])
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
XInitThreads ();
|
||||||
|
#endif
|
||||||
|
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
GtkWidget *screen;
|
GtkWidget *screen;
|
||||||
GtkWidget *vbox, *combo;
|
GtkWidget *vbox, *combo;
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <gst/video/videooverlay.h>
|
#include <gst/video/videooverlay.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static gint delay = 0;
|
static gint delay = 0;
|
||||||
static gint saveddelay = 0;
|
static gint saveddelay = 0;
|
||||||
static gint method = 1;
|
static gint method = 1;
|
||||||
|
@ -200,6 +204,10 @@ main (gint argc, gchar * argv[])
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
XInitThreads ();
|
||||||
|
#endif
|
||||||
|
|
||||||
context = g_option_context_new (NULL);
|
context = g_option_context_new (NULL);
|
||||||
g_option_context_add_main_entries (context, options, NULL);
|
g_option_context_add_main_entries (context, options, NULL);
|
||||||
g_option_context_add_group (context, gst_init_get_option_group ());
|
g_option_context_add_group (context, gst_init_get_option_group ());
|
||||||
|
@ -219,7 +227,7 @@ main (gint argc, gchar * argv[])
|
||||||
if (source_desc == NULL) {
|
if (source_desc == NULL) {
|
||||||
source_desc =
|
source_desc =
|
||||||
g_strdup
|
g_strdup
|
||||||
("videotestsrc ! video/x-raw, width=352, height=288 ! identity");
|
("videotestsrc ! video/x-raw, width=352, height=288 ! identity ! glupload");
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcebin =
|
sourcebin =
|
||||||
|
|
|
@ -4,8 +4,8 @@ gtkvideooverlay_SOURCES = main.cpp
|
||||||
|
|
||||||
gtkvideooverlay_CXXFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
gtkvideooverlay_CXXFLAGS=-I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CXXFLAGS) \
|
||||||
$(GL_CFLAGS) $(GTK3_CFLAGS)
|
$(GL_CFLAGS) $(GTK3_CFLAGS) $(X11_CFLAGS)
|
||||||
gtkvideooverlay_LDADD=../libgstgtkhelper.la \
|
gtkvideooverlay_LDADD=../libgstgtkhelper.la \
|
||||||
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
$(GTK3_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_LIBS) \
|
||||||
$(GL_LIBS) -lgstvideo-$(GST_API_VERSION)
|
$(GL_LIBS) -lgstvideo-$(GST_API_VERSION) $(X11_LIBS)
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,20 @@
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
|
|
||||||
#include "../gstgtk.h"
|
#include "../gstgtk.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget)
|
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[])
|
gint main (gint argc, gchar *argv[])
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_X11
|
||||||
|
XInitThreads ();
|
||||||
|
#endif
|
||||||
|
|
||||||
GtkWidget *area;
|
GtkWidget *area;
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
gtk_init (&argc, &argv);
|
gtk_init (&argc, &argv);
|
||||||
|
|
Loading…
Reference in a new issue