mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
[228/906] output shaders info log only if GST_GL_SHADER_DEBUG env variable is set. Should fix TODO task 18
This commit is contained in:
parent
cd20053491
commit
34663eccd9
1 changed files with 20 additions and 0 deletions
|
@ -51,6 +51,11 @@ struct _GstGLShaderPrivate
|
|||
|
||||
G_DEFINE_TYPE (GstGLShader, gst_gl_shader, G_TYPE_OBJECT);
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "GstGLShader"
|
||||
|
||||
gboolean _gst_gl_shader_debug = FALSE;
|
||||
|
||||
static void
|
||||
gst_gl_shader_finalize (GObject * object)
|
||||
{
|
||||
|
@ -126,6 +131,15 @@ gst_gl_shader_get_property (GObject * object,
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_shader_log_handler (const gchar *domain, GLogLevelFlags flags,
|
||||
const gchar *message, gpointer user_data)
|
||||
{
|
||||
if (_gst_gl_shader_debug) {
|
||||
g_log_default_handler (domain, flags, message, user_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_shader_class_init (GstGLShaderClass * klass)
|
||||
{
|
||||
|
@ -230,6 +244,12 @@ gst_gl_shader_init (GstGLShader * self)
|
|||
|
||||
priv->compiled = FALSE;
|
||||
priv->active = FALSE; // unused at the moment
|
||||
|
||||
if (g_getenv ("GST_GL_SHADER_DEBUG"))
|
||||
_gst_gl_shader_debug = TRUE;
|
||||
|
||||
g_log_set_handler ("GstGLShader", G_LOG_LEVEL_DEBUG,
|
||||
gst_gl_shader_log_handler, NULL);
|
||||
}
|
||||
|
||||
GstGLShader *
|
||||
|
|
Loading…
Reference in a new issue