]> git.sesse.net Git - vlc/blobdiff - modules/video_output/ios.m
Used WGL_EXT_swap_control in glwin32.
[vlc] / modules / video_output / ios.m
index c90ac61054f4c488ff5712c5f4712a199b62c31f..d49aed2f094a9b1e7ed82f3bff66464efd9aff97 100644 (file)
@@ -27,6 +27,8 @@
 
 #import <UIKit/UIKit.h>
 #import <OpenGLES/ES1/gl.h>
+#import <OpenGLES/ES1/glext.h>
+#include <QuartzCore/QuartzCore.h>
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
-#include <vlc_vout_opengl.h>
+#include <vlc_opengl.h>
 
 #define USE_OPENGL_ES 1
+
 #include "opengl.h"
-#include <QuartzCore/QuartzCore.h>
 
 /**
  * Forward declarations
@@ -48,12 +50,12 @@ static int Open(vlc_object_t *);
 static void Close(vlc_object_t *);
 
 static picture_pool_t *Pool(vout_display_t *vd, unsigned requested_count);
-static void PictureRender(vout_display_t *vd, picture_t *pic);
-static void PictureDisplay(vout_display_t *vd, picture_t *pic);
+static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture);
+static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture);
 static int Control (vout_display_t *vd, int query, va_list ap);
 
-static int OpenglClean(vout_opengl_t *gl);
-static void OpenglSwap(vout_opengl_t *gl);
+static int OpenglClean(vlc_gl_t *gl);
+static void OpenglSwap(vlc_gl_t *gl);
 
 /**
  * Module declaration
@@ -91,8 +93,8 @@ struct vout_display_sys_t
     VLCOpenGLESVideoView *glView;
     UIView * container;
 
-    vout_opengl_t gl;
-    vout_display_opengl_t vgl;
+    vlc_gl_t gl;
+    vout_display_opengl_t *vgl;
 
     picture_pool_t *pool;
     picture_t *current;
@@ -146,9 +148,11 @@ static int Open(vlc_object_t *this)
     sys->gl.lock = OpenglClean; // We don't do locking, but sometimes we need to cleanup the framebuffer
     sys->gl.unlock = NULL;
     sys->gl.swap = OpenglSwap;
+       sys->gl.getProcAddress = NULL;
     sys->gl.sys = sys;
 
-    if (vout_display_opengl_Init(&sys->vgl, &vd->fmt, &sys->gl))
+       sys->vgl = vout_display_opengl_New(&vd->fmt, NULL, &sys->gl);
+       if (!sys->vgl)
     {
         sys->gl.sys = NULL;
         goto error;
@@ -194,7 +198,7 @@ void Close(vlc_object_t *this)
     [sys->glView release];
 
     if (sys->gl.sys != NULL)
-        vout_display_opengl_Clean(&sys->vgl);
+        vout_display_opengl_Delete(sys->vgl);
 
     free (sys);
 }
@@ -206,27 +210,27 @@ void Close(vlc_object_t *this)
 static picture_pool_t *Pool(vout_display_t *vd, unsigned requested_count)
 {
     vout_display_sys_t *sys = vd->sys;
-    VLC_UNUSED(requested_count);
 
     if (!sys->pool)
-        sys->pool = vout_display_opengl_GetPool (&sys->vgl);
+        sys->pool = vout_display_opengl_GetPool (sys->vgl, requested_count);
     assert(sys->pool);
     return sys->pool;
 }
 
-static void PictureRender(vout_display_t *vd, picture_t *pic)
+static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    vout_display_opengl_Prepare( &sys->vgl, pic );
+    vout_display_opengl_Prepare( sys->vgl, pic, subpicture );
 }
 
-static void PictureDisplay(vout_display_t *vd, picture_t *pic)
+static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
 {
     vout_display_sys_t *sys = vd->sys;
-    vout_display_opengl_Display(&sys->vgl, &vd->fmt );
+    vout_display_opengl_Display(sys->vgl, &vd->fmt );
     picture_Release (pic);
     sys->has_first_frame = true;
+       (void)subpicture;
 }
 
 static int Control (vout_display_t *vd, int query, va_list ap)
@@ -250,7 +254,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 
         case VOUT_DISPLAY_GET_OPENGL:
         {
-            vout_opengl_t **gl = va_arg (ap, vout_opengl_t **);
+            vlc_gl_t **gl = va_arg (ap, vlc_gl_t **);
             *gl = &sys->gl;
             return VLC_SUCCESS;
         }
@@ -267,13 +271,13 @@ static int Control (vout_display_t *vd, int query, va_list ap)
  * vout opengl callbacks
  *****************************************************************************/
 
-static int OpenglClean(vout_opengl_t *gl) {
+static int OpenglClean(vlc_gl_t *gl) {
     vout_display_sys_t *sys = gl->sys;
     [sys->glView cleanFramebuffer];
     return 0;
 }
 
-static void OpenglSwap(vout_opengl_t *gl)
+static void OpenglSwap(vlc_gl_t *gl)
 {
     vout_display_sys_t *sys = gl->sys;
     EAGLContext *context = [sys->glView context];