Commit a7bcc420 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵 Committed by Tim-Philipp Müller

ges: Hide internal debug category behind a GOnce

Otherwise it might be used (e.g. by the plugin loader via the GES
plugin!) before ges_init() is called.
parent 1864da82
Pipeline #68510 passed with stages
in 36 minutes and 10 seconds
......@@ -34,11 +34,13 @@
G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
#ifndef GST_CAT_DEFAULT
#define GST_CAT_DEFAULT _ges_debug
#define GST_CAT_DEFAULT (_ges_debug ())
#endif
G_GNUC_INTERNAL
GstDebugCategory * _ges_debug (void);
/* The first 2 NLE priorities are used for:
* 0- The Mixing element
* 1- The Gaps
......
......@@ -43,7 +43,7 @@
#define GES_GNONLIN_VERSION_NEEDED_MINOR 2
#define GES_GNONLIN_VERSION_NEEDED_MICRO 0
GST_DEBUG_CATEGORY (_ges_debug);
GST_DEBUG_CATEGORY (_ges_debug_category);
G_LOCK_DEFINE_STATIC (init_lock);
......@@ -52,6 +52,35 @@ G_LOCK_DEFINE_STATIC (init_lock);
*/
static GThread *initialized_thread = NULL;
#ifndef GST_DISABLE_GST_DEBUG
static gpointer
init_debug_category (gpointer data)
{
/* initialize debugging category */
GST_DEBUG_CATEGORY_INIT (_ges_debug_category, "ges", GST_DEBUG_FG_YELLOW,
"GStreamer Editing Services");
return _ges_debug_category;
}
GstDebugCategory *
_ges_debug (void)
{
static GOnce my_once = G_ONCE_INIT;
g_once (&my_once, init_debug_category, NULL);
return my_once.retval;
}
#else
GstDebugCategory *
_ges_debug (void)
{
return NULL;
}
#endif
static gboolean
ges_init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
GError ** error)
......@@ -61,10 +90,6 @@ ges_init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
return TRUE;
}
/* initialize debugging category */
GST_DEBUG_CATEGORY_INIT (_ges_debug, "ges", GST_DEBUG_FG_YELLOW,
"GStreamer Editing Services");
return TRUE;
}
......
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