changeset 35087:078a00af881c

Use OSX common layer in -vo gl. This has many, quite serious issues but already does something useful and the amount of code changes necessary to make it work properly should not be too large.
author reimar
date Thu, 13 Sep 2012 19:22:31 +0000
parents 8848682f4035
children 8287c476bf53
files libvo/gl_common.c libvo/gl_common.h libvo/osx_common.h libvo/vo_gl.c
diffstat 4 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Thu Sep 13 19:20:47 2012 +0000
+++ b/libvo/gl_common.c	Thu Sep 13 19:22:31 2012 +0000
@@ -2276,6 +2276,9 @@
 static void releaseGlContext_dummy(MPGLContext *ctx) {
 }
 
+static void swapGlBuffers_dummy(MPGLContext *ctx) {
+}
+
 static int dummy_check_events(void) {
   return 0;
 }
@@ -2304,6 +2307,7 @@
   memset(ctx, 0, sizeof(*ctx));
   ctx->setGlWindow = setGlWindow_dummy;
   ctx->releaseGlContext = releaseGlContext_dummy;
+  ctx->swapGlBuffers = swapGlBuffers_dummy;
   ctx->update_xinerama_info = dummy_update_xinerama_info;
   ctx->check_events = dummy_check_events;
   ctx->type = type;
@@ -2353,6 +2357,15 @@
     ctx->ontop = vo_x11_ontop;
     return vo_init();
 #endif
+#ifdef CONFIG_COREVIDEO
+  case GLTYPE_OSX:
+//    ctx->swapGlBuffers = swapGlBuffers_osx;
+    ctx->update_xinerama_info = vo_osx_update_xinerama_info;
+    ctx->check_events = vo_osx_check_events;
+    ctx->fullscreen = vo_osx_fullscreen;
+    ctx->ontop = vo_osx_ontop;
+    return vo_osx_init();
+#endif
   default:
     return 0;
   }
@@ -2376,6 +2389,11 @@
     vo_sdl_uninit();
     break;
 #endif
+#ifdef CONFIG_COREVIDEO
+  case GLTYPE_OSX:
+    vo_osx_uninit();
+    break;
+#endif
   }
   memset(ctx, 0, sizeof(*ctx));
 }
--- a/libvo/gl_common.h	Thu Sep 13 19:20:47 2012 +0000
+++ b/libvo/gl_common.h	Thu Sep 13 19:22:31 2012 +0000
@@ -44,6 +44,9 @@
 #include <EGL/egl.h>
 #include "x11_common.h"
 #endif
+#ifdef CONFIG_COREVIDEO
+#include "osx_common.h"
+#endif
 #include <GL/gl.h>
 
 // workaround for some gl.h headers
@@ -451,6 +454,7 @@
   GLTYPE_X11,
   GLTYPE_SDL,
   GLTYPE_EGL_X11,
+  GLTYPE_OSX,
   GLTYPE_COUNT
 };
 
--- a/libvo/osx_common.h	Thu Sep 13 19:20:47 2012 +0000
+++ b/libvo/osx_common.h	Thu Sep 13 19:22:31 2012 +0000
@@ -24,4 +24,12 @@
 void config_movie_aspect(float config_aspect);
 void osx_foreground_hack(void);
 
+int vo_osx_init(void);
+int vo_osx_config(uint32_t, uint32_t, uint32_t);
+void vo_osx_uninit(void);
+void vo_osx_ontop(void);
+void vo_osx_fullscreen(void);
+int vo_osx_check_events(void);
+void vo_osx_update_xinerama_info(void);
+
 #endif /* MPLAYER_OSX_COMMON_H */
--- a/libvo/vo_gl.c	Thu Sep 13 19:20:47 2012 +0000
+++ b/libvo/vo_gl.c	Thu Sep 13 19:22:31 2012 +0000
@@ -631,6 +631,10 @@
   if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
     return -1;
 #endif
+#ifdef CONFIG_COREVIDEO
+  if (glctx.type == GLTYPE_OSX && !vo_osx_config(d_width, d_height, flags))
+    return -1;
+#endif
 #ifdef CONFIG_GL_EGL_X11
   if (glctx.type == GLTYPE_EGL_X11) {
     XVisualInfo vinfo = { .visual = CopyFromParent, .depth = CopyFromParent };