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;
}
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}