#include "gsteglimage.h"
#include "gstglmemoryegl.h"
-GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
-#define GST_CAT_DEFAULT gst_gl_display_debug
+GST_DEBUG_CATEGORY_STATIC (gst_gl_display_egl_debug);
+#define GST_CAT_DEFAULT gst_gl_display_egl_debug
#ifndef EGL_PLATFORM_X11
#define EGL_PLATFORM_X11 0x31D5
static guintptr gst_gl_display_egl_get_handle (GstGLDisplay * display);
static gboolean gst_gl_display_egl_get_foreign_display (GstGLDisplay * display);
+static void
+init_debug (void)
+{
+ static volatile gsize _init = 0;
+
+ if (g_once_init_enter (&_init)) {
+ GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gldisplayegl", 0,
+ "OpenGL EGL Display");
+ g_once_init_leave (&_init, 1);
+ }
+}
+
static void
gst_gl_display_egl_class_init (GstGLDisplayEGLClass * klass)
{
g_return_val_if_fail ((type != GST_GL_DISPLAY_TYPE_ANY && display != 0)
|| (type == GST_GL_DISPLAY_TYPE_ANY && display == 0), EGL_NO_DISPLAY);
- GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay");
+ init_debug ();
/* given an EGLDisplay already */
if (type == GST_GL_DISPLAY_TYPE_EGL)
{
GstGLDisplayEGL *ret;
- GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay");
+ init_debug ();
ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL);
gst_object_ref_sink (ret);
g_return_val_if_fail (display != NULL, NULL);
- GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay");
+ init_debug ();
ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL);
gst_object_ref_sink (ret);
g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL);
- GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay");
+ init_debug ();
if (GST_IS_GL_DISPLAY_EGL (display)) {
GST_LOG_OBJECT (display, "display %" GST_PTR_FORMAT "is already a "