diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index b0a5d6b1ae..bd83f88d87 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -1415,7 +1415,7 @@ gst_gl_context_egl_request_config (GstGLContext * context, } gboolean -gst_gl_context_egl_fill_info (GstGLContext * context) +gst_gl_context_egl_fill_info (GstGLContext * context, GError ** error) { EGLContext egl_context = (EGLContext) gst_gl_context_get_gl_context (context); GstGLDisplay *display_egl; @@ -1426,7 +1426,8 @@ gst_gl_context_egl_fill_info (GstGLContext * context) int attrs[3]; if (!egl_context) { - GST_ERROR_OBJECT (context, "no GLX context"); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE, "no EGL context"); return FALSE; } @@ -1439,6 +1440,10 @@ gst_gl_context_egl_fill_info (GstGLContext * context) GST_WARNING_OBJECT (context, "could not retrieve egl config id from egl context: %s", gst_egl_get_error_string (eglGetError ())); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_WRONG_CONFIG, + "could not retrieve egl config id from egl context: %s", + gst_egl_get_error_string (eglGetError ())); goto failure; } @@ -1451,6 +1456,10 @@ gst_gl_context_egl_fill_info (GstGLContext * context) GST_WARNING_OBJECT (context, "could not retrieve egl config from its ID 0x%x. " "Wrong EGLDisplay or context?", config_id); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_WRONG_CONFIG, + "could not retrieve egl config from its ID 0x%x. " + "Wrong EGLDisplay or context?", config_id); goto failure; } @@ -1458,6 +1467,9 @@ gst_gl_context_egl_fill_info (GstGLContext * context) if (!config) { GST_WARNING_OBJECT (context, "could not transform config id 0x%x into " "GstStructure", config_id); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_WRONG_CONFIG, + "could not transform config id 0x%x into GstStructure", config_id); goto failure; } diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.h b/gst-libs/gst/gl/egl/gstglcontext_egl.h index 6d9a8a7aec..644731f368 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.h +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.h @@ -92,7 +92,7 @@ G_GNUC_INTERNAL gpointer gst_gl_context_egl_get_proc_address (GstGLAPI gl_api, const gchar * name); G_GNUC_INTERNAL -gboolean gst_gl_context_egl_fill_info (GstGLContext * context); +gboolean gst_gl_context_egl_fill_info (GstGLContext * context, GError ** error); G_END_DECLS diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 06215d840c..4e7fe91875 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -1546,12 +1546,12 @@ gst_gl_context_fill_info (GstGLContext * context, GError ** error) /* XXX: vfunc? */ #if GST_GL_HAVE_PLATFORM_GLX if (gst_gl_context_get_gl_platform (context) == GST_GL_PLATFORM_GLX - && !gst_gl_context_glx_fill_info (context)) + && !gst_gl_context_glx_fill_info (context, error)) goto failure; #endif #if GST_GL_HAVE_PLATFORM_EGL if (gst_gl_context_get_gl_platform (context) == GST_GL_PLATFORM_EGL - && !gst_gl_context_egl_fill_info (context)) + && !gst_gl_context_egl_fill_info (context, error)) goto failure; #endif } diff --git a/gst-libs/gst/gl/x11/gstglcontext_glx.c b/gst-libs/gst/gl/x11/gstglcontext_glx.c index 68d8e636f7..7dd719a6c1 100644 --- a/gst-libs/gst/gl/x11/gstglcontext_glx.c +++ b/gst-libs/gst/gl/x11/gstglcontext_glx.c @@ -969,7 +969,7 @@ gst_gl_context_glx_request_config (GstGLContext * context, } gboolean -gst_gl_context_glx_fill_info (GstGLContext * context) +gst_gl_context_glx_fill_info (GstGLContext * context, GError ** error) { GLXContext glx_context = (GLXContext) gst_gl_context_get_gl_context (context); GstStructure *config; @@ -980,7 +980,8 @@ gst_gl_context_glx_fill_info (GstGLContext * context) int attrs[3]; if (!glx_context) { - GST_ERROR_OBJECT (context, "no GLX context"); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE, "No GLX context"); return FALSE; } @@ -988,6 +989,9 @@ gst_gl_context_glx_fill_info (GstGLContext * context) if (!glXQueryVersion (device, &glx_major, &glx_minor)) { GST_WARNING_OBJECT (context, "could not retrieve GLX version"); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE, + "could not retrieve GLX version"); return FALSE; } @@ -1001,6 +1005,9 @@ gst_gl_context_glx_fill_info (GstGLContext * context) &fbconfig_id)) { GST_WARNING_OBJECT (context, "could not retrieve fbconfig id from glx context"); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_WRONG_CONFIG, + "could not retrieve fbconfig id from glx context"); goto failure; } @@ -1014,6 +1021,10 @@ gst_gl_context_glx_fill_info (GstGLContext * context) GST_WARNING_OBJECT (context, "could not retrieve fbconfig from its ID 0x%x. " "Wrong Display or Screen?", fbconfig_id); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_WRONG_CONFIG, + "could not retrieve fbconfig from its ID 0x%x. " + "Wrong Display or Screen?", fbconfig_id); goto failure; } @@ -1021,6 +1032,9 @@ gst_gl_context_glx_fill_info (GstGLContext * context) if (!config) { GST_WARNING_OBJECT (context, "could not transform fbconfig id 0x%x into " "GstStructure.", fbconfig_id); + g_set_error (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_WRONG_CONFIG, + "could not transform fbconfig id 0x%x into GstStructure.", fbconfig_id); goto failure; } diff --git a/gst-libs/gst/gl/x11/gstglcontext_glx.h b/gst-libs/gst/gl/x11/gstglcontext_glx.h index e084cb545d..20b3b28dce 100644 --- a/gst-libs/gst/gl/x11/gstglcontext_glx.h +++ b/gst-libs/gst/gl/x11/gstglcontext_glx.h @@ -69,7 +69,7 @@ G_GNUC_INTERNAL gpointer gst_gl_context_glx_get_proc_address (GstGLAPI gl_api, const gchar * name); G_GNUC_INTERNAL -gboolean gst_gl_context_glx_fill_info (GstGLContext * context); +gboolean gst_gl_context_glx_fill_info (GstGLContext * context, GError ** error); G_END_DECLS