[vlc-commits] interop_cvpx: use ios-eaglcontext from the global state

Alexandre Janniaux git at videolan.org
Thu Nov 12 12:17:36 CET 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Fri Nov  6 12:09:57 2020 +0100| [b530cdbd56f501f214e466935b9417bdef1377cf] | committer: Alexandre Janniaux

interop_cvpx: use ios-eaglcontext from the global state

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

 modules/video_output/Makefile.am           | 1 +
 modules/video_output/opengl/interop_cvpx.m | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
index 06d2e9bb74..efd3201815 100644
--- a/modules/video_output/Makefile.am
+++ b/modules/video_output/Makefile.am
@@ -45,6 +45,7 @@ vout_LTLIBRARIES += libvout_macosx_plugin.la libcaopengllayer_plugin.la \
 endif
 if HAVE_IOS
 libglinterop_cvpx_plugin_la_CFLAGS = $(AM_CFLAGS) -DUSE_OPENGL_ES2
+libglinterop_cvpx_plugin_la_LDFLAGS += -Wl,-framework,IOSurface,-framework,OpenGLES
 endif
 
 libvout_ios_plugin_la_SOURCES = video_output/ios.m
diff --git a/modules/video_output/opengl/interop_cvpx.m b/modules/video_output/opengl/interop_cvpx.m
index b7c0b47672..4508e096b1 100644
--- a/modules/video_output/opengl/interop_cvpx.m
+++ b/modules/video_output/opengl/interop_cvpx.m
@@ -31,6 +31,7 @@
 #include <OpenGLES/ES2/gl.h>
 #include <OpenGLES/ES2/glext.h>
 #include <CoreVideo/CVOpenGLESTextureCache.h>
+#include <OpenGLES/EAGL.h>
 #else
 #include <IOSurface/IOSurface.h>
 #endif
@@ -184,10 +185,10 @@ Open(vlc_object_t *obj)
     const GLenum tex_target = GL_TEXTURE_2D;
 
     {
-        CVEAGLContext eagl_ctx = var_InheritAddress(interop->gl, "ios-eaglcontext");
+        CVEAGLContext eagl_ctx = [EAGLContext currentContext];
         if (!eagl_ctx)
         {
-            msg_Err(interop->gl, "can't find ios-eaglcontext");
+            msg_Warn(&interop->obj, "OpenGL provider is not using CAEAGL, cannot use interop_cvpx");
             free(priv);
             return VLC_EGENERIC;
         }



More information about the vlc-commits mailing list