Commit 96b9666d authored by Matthew Waters's avatar Matthew Waters
Browse files

gl/eagl: try getting a gles3 context

Fallback to a gles2 context if that fails
parent 7287564f
......@@ -219,17 +219,28 @@ gst_gl_context_eagl_create_context (GstGLContext * context, GstGLAPI gl_api,
GstGLContextEagl *context_eagl = GST_GL_CONTEXT_EAGL (context);
GstGLContextEaglPrivate *priv = context_eagl->priv;
EAGLSharegroup *share_group;
if (other_context) {
EAGLContext *external_gl_context = (EAGLContext *)
gst_gl_context_get_gl_context (other_context);
EAGLSharegroup *share_group = [external_gl_context sharegroup];
priv->eagl_context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2 sharegroup:share_group];
[share_group release];
share_group = [external_gl_context sharegroup];
} else {
priv->eagl_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
share_group = nil;
priv->eagl_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:share_group];
if (!priv->eagl_context) {
priv->eagl_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:share_group];
if (!priv->eagl_context) {
"Failed to create OpenGL ES context");
return FALSE;
if (share_group)
[share_group release];
priv->eagl_layer = NULL;
priv->framebuffer = 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment