mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
[807/906] context: Move some window error enums to context
This commit is contained in:
parent
57c32baab7
commit
d9cc31aca0
4 changed files with 25 additions and 21 deletions
|
@ -143,8 +143,8 @@ gst_gl_context_egl_choose_format (GstGLContext * context, GError ** error)
|
|||
gst_object_unref (window);
|
||||
|
||||
if (ret == 0) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
"Failed to match XVisualInfo");
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG, "Failed to match XVisualInfo");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,8 @@ gst_gl_context_egl_create_context (GstGLContext * context,
|
|||
|
||||
if (other_context) {
|
||||
if (!GST_GL_IS_CONTEXT_EGL (other_context)) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
|
||||
"Cannot share context with non-EGL context");
|
||||
goto failure;
|
||||
}
|
||||
|
|
|
@ -54,10 +54,7 @@ G_BEGIN_DECLS
|
|||
typedef enum
|
||||
{
|
||||
GST_GL_WINDOW_ERROR_FAILED,
|
||||
GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
GST_GL_WINDOW_ERROR_WRONG_API,
|
||||
GST_GL_WINDOW_ERROR_OLD_LIBS,
|
||||
GST_GL_WINDOW_ERROR_CREATE_CONTEXT,
|
||||
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
||||
} GstGLWindowError;
|
||||
|
||||
|
|
|
@ -97,7 +97,8 @@ gst_gl_context_wgl_create_context (GstGLContext * context,
|
|||
|
||||
if (other_context) {
|
||||
if (!GST_GL_IS_CONTEXT_WGL (other_context)) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
|
||||
"Cannot share context with a non-WGL context");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -109,8 +110,9 @@ gst_gl_context_wgl_create_context (GstGLContext * context,
|
|||
GST_DEBUG ("gl context created: %" G_GUINTPTR_FORMAT,
|
||||
(guintptr) context_wgl->wgl_context);
|
||||
else {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_CREATE_CONTEXT,
|
||||
"failed to create glcontext:0x%x", (unsigned int) GetLastError ());
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_CREATE_CONTEXT, "failed to create glcontext:0x%x",
|
||||
(unsigned int) GetLastError ());
|
||||
goto failure;
|
||||
}
|
||||
g_assert (context_wgl->wgl_context);
|
||||
|
@ -120,8 +122,8 @@ gst_gl_context_wgl_create_context (GstGLContext * context,
|
|||
|
||||
if (other_wgl) {
|
||||
if (!wglShareLists (other_wgl->wgl_context, context_wgl->wgl_context)) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR,
|
||||
GST_GL_WINDOW_ERROR_CREATE_CONTEXT, "failed to share contexts 0x%x",
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_CREATE_CONTEXT, "failed to share contexts 0x%x",
|
||||
(unsigned int) GetLastError ());
|
||||
goto failure;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,8 @@ gst_gl_context_glx_create_context (GstGLContext * context,
|
|||
GstGLWindow *other_window;
|
||||
|
||||
if (!GST_GL_IS_CONTEXT_GLX (other_context)) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
|
||||
"Cannot share context with non-GLX context");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -222,8 +223,8 @@ gst_gl_context_glx_create_context (GstGLContext * context,
|
|||
XFree (context_glx->priv->fbconfigs);
|
||||
|
||||
if (!context_glx->glx_context) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_CREATE_CONTEXT,
|
||||
"Failed to create opengl context");
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_CREATE_CONTEXT, "Failed to create opengl context");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -274,14 +275,15 @@ gst_gl_context_glx_choose_format (GstGLContext * context, GError ** error)
|
|||
device = (Display *) gst_gl_window_get_display (window);
|
||||
|
||||
if (!glXQueryExtension (device, &error_base, &event_base)) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR,
|
||||
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE, "No GLX extension");
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE, "No GLX extension");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (!glXQueryVersion (device, &context_glx->priv->glx_major,
|
||||
&context_glx->priv->glx_minor)) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_CREATE_CONTEXT,
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
|
||||
"Failed to query GLX version (glXQueryVersion failed)");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -306,7 +308,8 @@ gst_gl_context_glx_choose_format (GstGLContext * context, GError ** error)
|
|||
window_x11->screen_num, attribs);
|
||||
|
||||
if (!window_x11->visual_info) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
|
||||
"Bad attributes in glXChooseVisual");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -326,7 +329,8 @@ gst_gl_context_glx_choose_format (GstGLContext * context, GError ** error)
|
|||
DefaultScreen (device), attribs, &fbcount);
|
||||
|
||||
if (!context_glx->priv->fbconfigs) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG,
|
||||
"Could not find any FBConfig's to use (check attributes?)");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -337,8 +341,8 @@ gst_gl_context_glx_choose_format (GstGLContext * context, GError ** error)
|
|||
context_glx->priv->fbconfigs[0]);
|
||||
|
||||
if (!window_x11->visual_info) {
|
||||
g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_WRONG_CONFIG,
|
||||
"Bad attributes in FBConfig");
|
||||
g_set_error (error, GST_GL_CONTEXT_ERROR,
|
||||
GST_GL_CONTEXT_ERROR_WRONG_CONFIG, "Bad attributes in FBConfig");
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue