eglglessink: Add log reporting at shader compilation failure

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-17 10:47:39 -03:00 committed by Sebastian Dröge
parent b4887425cc
commit 28aadcad4e

View file

@ -1166,6 +1166,7 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink)
GLint test; GLint test;
GLuint verthandle, fraghandle, prog; GLuint verthandle, fraghandle, prog;
GLboolean ret; GLboolean ret;
GLchar *info_log;
GST_DEBUG_OBJECT (eglglessink, "Enter EGL surface setup"); GST_DEBUG_OBJECT (eglglessink, "Enter EGL surface setup");
@ -1221,6 +1222,11 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink)
GST_DEBUG_OBJECT (eglglessink, "Successfully compiled vertex shader"); GST_DEBUG_OBJECT (eglglessink, "Successfully compiled vertex shader");
else { else {
GST_ERROR_OBJECT (eglglessink, "Couldn't compile vertex shader"); GST_ERROR_OBJECT (eglglessink, "Couldn't compile vertex shader");
glGetShaderiv (verthandle, GL_INFO_LOG_LENGTH, &test);
info_log = g_new0 (GLchar, test);
glGetShaderInfoLog (verthandle, test, NULL, info_log);
GST_INFO_OBJECT (eglglessink, "Compilation info log:\n%s", info_log);
g_free (info_log);
goto HANDLE_ERROR; goto HANDLE_ERROR;
} }
@ -1238,6 +1244,11 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink)
GST_DEBUG_OBJECT (eglglessink, "Successfully compiled fragment shader"); GST_DEBUG_OBJECT (eglglessink, "Successfully compiled fragment shader");
else { else {
GST_ERROR_OBJECT (eglglessink, "Couldn't compile fragment shader"); GST_ERROR_OBJECT (eglglessink, "Couldn't compile fragment shader");
glGetShaderiv (fraghandle, GL_INFO_LOG_LENGTH, &test);
info_log = g_new0 (GLchar, test);
glGetShaderInfoLog (fraghandle, test, NULL, info_log);
GST_INFO_OBJECT (eglglessink, "Compilation info log:\n%s", info_log);
g_free (info_log);
goto HANDLE_ERROR; goto HANDLE_ERROR;
} }