[vlc-commits] vout: ios: hide eaglContext

Thomas Guillem git at videolan.org
Wed Mar 7 15:34:18 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar  6 19:07:22 2018 +0100| [d7e2a4ff166b48b4410e54a3af94dc86dc0a9119] | committer: Thomas Guillem

vout: ios: hide eaglContext

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d7e2a4ff166b48b4410e54a3af94dc86dc0a9119
---

 modules/video_output/ios.m | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 2c56d22d25..28f259ed8b 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -107,12 +107,12 @@ vlc_module_end ()
     /* Written from vout, read locked from MT */
     vout_display_cfg_t _cfg;
 }
- at property (readonly) EAGLContext* eaglContext;
 
 - (id)initWithFrameAndVd:(CGRect)frame withVd:(vout_display_t*)vd;
 - (void)cleanAndRelease;
 - (BOOL)makeCurrentWithGL:(EAGLContext **)previousEaglContext withGL:(vlc_gl_t *)gl;
 - (void)releaseCurrent:(EAGLContext *)previousEaglContext;
+- (void)presentRenderbuffer;
 
 - (void)updateVoutCfg:(const vout_display_cfg_t *)cfg withVGL:(vout_display_opengl_t *)vgl;
 - (void)getPlaceLocked:(vout_display_place_t *)place;
@@ -199,8 +199,6 @@ static int Open(vlc_object_t *this)
         if (vlc_gl_MakeCurrent(sys->gl) != VLC_SUCCESS)
             goto bailout;
 
-        var_SetAddress(vd->obj.parent, "ios-eaglcontext", [sys->glESView eaglContext]);
-
         vout_display_opengl_t *vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas,
                                                              sys->gl, &vd->cfg->viewpoint);
         vlc_gl_ReleaseCurrent(sys->gl);
@@ -361,7 +359,7 @@ static void GLESSwap(vlc_gl_t *gl)
 {
     struct gl_sys *sys = gl->sys;
 
-    [[sys->glESView eaglContext] presentRenderbuffer:GL_RENDERBUFFER];
+    [sys->glESView presentRenderbuffer];
 }
 
 
@@ -369,7 +367,6 @@ static void GLESSwap(vlc_gl_t *gl)
  * Our UIView object
  *****************************************************************************/
 @implementation VLCOpenGLES2VideoView
- at synthesize eaglContext = _eaglContext;
 
 + (Class)layerClass
 {
@@ -418,6 +415,9 @@ static void GLESSwap(vlc_gl_t *gl)
     }
     [self releaseCurrent:previousEaglContext];
 
+    /* Set "ios-eaglcontext" to be used by cvpx fitlers/glconv */
+    var_SetAddress(_voutDisplay->obj.parent, "ios-eaglcontext", _eaglContext);
+
     _layer = (CAEAGLLayer *)self.layer;
     _layer.drawableProperties = [NSDictionary dictionaryWithObject:kEAGLColorFormatRGBA8 forKey: kEAGLDrawablePropertyColorFormat];
     _layer.opaque = YES;
@@ -623,6 +623,11 @@ static void GLESSwap(vlc_gl_t *gl)
     [EAGLContext setCurrentContext:previousEaglContext];
 }
 
+- (void)presentRenderbuffer
+{
+    [_eaglContext presentRenderbuffer:GL_RENDERBUFFER];
+}
+
 - (void)layoutSubviews
 {
     [self reshape];



More information about the vlc-commits mailing list