[MPlayer-cvslog] r35181 - in trunk/libvo: gl_common.c gl_common.h osx_common.h vo_gl.c

reimar subversion at mplayerhq.hu
Thu Sep 13 21:22:32 CEST 2012


Author: reimar
Date: Thu Sep 13 21:22:31 2012
New Revision: 35181

Log:
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.

Modified:
   trunk/libvo/gl_common.c
   trunk/libvo/gl_common.h
   trunk/libvo/osx_common.h
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Thu Sep 13 21:20:47 2012	(r35180)
+++ trunk/libvo/gl_common.c	Thu Sep 13 21:22:31 2012	(r35181)
@@ -2276,6 +2276,9 @@ static int setGlWindow_dummy(MPGLContext
 static void releaseGlContext_dummy(MPGLContext *ctx) {
 }
 
+static void swapGlBuffers_dummy(MPGLContext *ctx) {
+}
+
 static int dummy_check_events(void) {
   return 0;
 }
@@ -2304,6 +2307,7 @@ int init_mpglcontext(MPGLContext *ctx, e
   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 @@ int init_mpglcontext(MPGLContext *ctx, e
     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 @@ void uninit_mpglcontext(MPGLContext *ctx
     vo_sdl_uninit();
     break;
 #endif
+#ifdef CONFIG_COREVIDEO
+  case GLTYPE_OSX:
+    vo_osx_uninit();
+    break;
+#endif
   }
   memset(ctx, 0, sizeof(*ctx));
 }

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Thu Sep 13 21:20:47 2012	(r35180)
+++ trunk/libvo/gl_common.h	Thu Sep 13 21:22:31 2012	(r35181)
@@ -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 @@ enum MPGLType {
   GLTYPE_X11,
   GLTYPE_SDL,
   GLTYPE_EGL_X11,
+  GLTYPE_OSX,
   GLTYPE_COUNT
 };
 

Modified: trunk/libvo/osx_common.h
==============================================================================
--- trunk/libvo/osx_common.h	Thu Sep 13 21:20:47 2012	(r35180)
+++ trunk/libvo/osx_common.h	Thu Sep 13 21:22:31 2012	(r35181)
@@ -24,4 +24,12 @@ void change_movie_aspect(float new_aspec
 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 */

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Thu Sep 13 21:20:47 2012	(r35180)
+++ trunk/libvo/vo_gl.c	Thu Sep 13 21:22:31 2012	(r35181)
@@ -631,6 +631,10 @@ static int create_window(uint32_t d_widt
   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 };


More information about the MPlayer-cvslog mailing list