From 5592a966c6217673d604ec18648238d1498b7b8c Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 24 Jun 2016 13:41:11 +1000 Subject: [PATCH] Revert "Revert "gl/eagl: try getting a gles3 context"" This reverts commit eb142736318463e6e553c21707ba0d716f85a46f. vtdec now successfully outputs textures that can be converted by glcolorconvert in GLES3 contexts. --- gst-libs/gst/gl/eagl/gstglcontext_eagl.m | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/gl/eagl/gstglcontext_eagl.m b/gst-libs/gst/gl/eagl/gstglcontext_eagl.m index 42dde56..ecadc3f 100644 --- a/gst-libs/gst/gl/eagl/gstglcontext_eagl.m +++ b/gst-libs/gst/gl/eagl/gstglcontext_eagl.m @@ -219,17 +219,29 @@ 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) { + g_set_error_literal (error, GST_GL_CONTEXT_ERROR, + GST_GL_CONTEXT_ERROR_CREATE_CONTEXT, + "Failed to create OpenGL ES context"); + return FALSE; + } + + if (share_group) + [share_group release]; priv->eagl_layer = NULL; priv->framebuffer = 0; -- 2.7.4