mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
gl/calayer: provide the exact GL api version for the wrapped context
Otherwise we could end up being mistaken for the diference between a gl3 and a gl2 context resulting in a failure getting the list of extensions from the wrapped context due to the difference between glGetString and glGetStringi for the GL_EXTENSIONS token. https://bugzilla.gnome.org/show_bug.cgi?id=749728
This commit is contained in:
parent
be90a12916
commit
dec8139e65
1 changed files with 6 additions and 6 deletions
|
@ -109,10 +109,15 @@ _context_ready (gpointer data)
|
||||||
if (self->draw_context)
|
if (self->draw_context)
|
||||||
gst_object_unref (self->draw_context);
|
gst_object_unref (self->draw_context);
|
||||||
|
|
||||||
|
if (kCGLNoError != CGLSetCurrentContext (self->gl_context)) {
|
||||||
|
GST_ERROR ("failed set cgl context %p current", self->gl_context);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
display = gst_gl_context_get_display (GST_GL_CONTEXT (self->gst_gl_context));
|
display = gst_gl_context_get_display (GST_GL_CONTEXT (self->gst_gl_context));
|
||||||
self->draw_context = gst_gl_context_new_wrapped (display,
|
self->draw_context = gst_gl_context_new_wrapped (display,
|
||||||
(guintptr) self->gl_context, GST_GL_PLATFORM_CGL,
|
(guintptr) self->gl_context, GST_GL_PLATFORM_CGL,
|
||||||
gst_gl_display_get_gl_api (display));
|
gst_gl_context_get_current_gl_api (NULL, NULL));
|
||||||
gst_object_unref (display);
|
gst_object_unref (display);
|
||||||
|
|
||||||
if (!self->draw_context) {
|
if (!self->draw_context) {
|
||||||
|
@ -120,11 +125,6 @@ _context_ready (gpointer data)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kCGLNoError != CGLSetCurrentContext (self->gl_context)) {
|
|
||||||
GST_ERROR ("failed set cgl context %p current", self->gl_context);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_gl_context_activate (self->draw_context, TRUE);
|
gst_gl_context_activate (self->draw_context, TRUE);
|
||||||
if (!gst_gl_context_fill_info (self->draw_context, &error)) {
|
if (!gst_gl_context_fill_info (self->draw_context, &error)) {
|
||||||
GST_ERROR ("failed to fill wrapped context information: %s", error->message);
|
GST_ERROR ("failed to fill wrapped context information: %s", error->message);
|
||||||
|
|
Loading…
Reference in a new issue