Commit 01961ec4 authored by Julien Isorce's avatar Julien Isorce Committed by Tim-Philipp Müller

glwindow: initialize debug in class_init

Useful if one uses gst_gl_window_x11_new directly
instead of gst_gl_window_new.
parent a81de2f2
......@@ -164,6 +164,18 @@ gst_gl_window_default_close (GstGLWindow * window)
g_main_context_unref (priv->main_context);
}
static void
_init_debug (void)
{
static volatile gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_INIT (gst_gl_window_debug, "glwindow", 0,
"glwindow element");
g_once_init_leave (&_init, 1);
}
}
static void
gst_gl_window_init (GstGLWindow * window)
{
......@@ -228,6 +240,8 @@ gst_gl_window_class_init (GstGLWindowClass * klass)
g_signal_new ("key-event", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
_init_debug ();
}
/**
......@@ -243,15 +257,10 @@ gst_gl_window_new (GstGLDisplay * display)
{
GstGLWindow *window = NULL;
const gchar *user_choice;
static volatile gsize _init = 0;
g_return_val_if_fail (display != NULL, NULL);
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_INIT (gst_gl_window_debug, "glwindow", 0,
"glwindow element");
g_once_init_leave (&_init, 1);
}
_init_debug ();
user_choice = g_getenv ("GST_GL_WINDOW");
GST_INFO ("creating a window, user choice:%s", user_choice);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment