[vlc-devel] commit: minimal_macosx: "drawable-agl" and "drawable-gl" split ( Jean-Paul Saman )

git version control git at videolan.org
Tue Mar 17 16:07:53 CET 2009


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Thu Mar  5 11:37:50 2009 +0100| [9d926a9e6380711e8e61bfe63e3c3876a3749b7d] | committer: Jean-Paul Saman 

minimal_macosx: "drawable-agl" and "drawable-gl" split

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

 modules/gui/minimal_macosx/VLCOpenGLVoutView.m |    8 ++++----
 modules/gui/minimal_macosx/voutagl.m           |   10 ++++++----
 modules/gui/minimal_macosx/voutgl.m            |   13 ++++++++-----
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/modules/gui/minimal_macosx/VLCOpenGLVoutView.m b/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
index 62fea6f..8c078c3 100644
--- a/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
+++ b/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * VLCOpenGLVoutView.m: MacOS X OpenGL provider
  *****************************************************************************
- * Copyright (C) 2001-2007 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Colin Delacroix <colin at zoy.org>
@@ -49,8 +49,8 @@ int cocoaglvoutviewInit( vout_thread_t * p_vout )
 
     msg_Dbg( p_vout, "Mac OS X Vout is opening" );
 
-    var_Create( p_vout, "drawable", VLC_VAR_DOINHERIT );
-    var_Get( p_vout, "drawable", &value_drawable );
+    var_Create( p_vout, "drawable-gl", VLC_VAR_DOINHERIT );
+    var_Get( p_vout, "drawabl-gl", &value_drawable );
 
     p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
 
@@ -81,7 +81,7 @@ void cocoaglvoutviewEnd( vout_thread_t * p_vout )
     id <VLCOpenGLVoutEmbedding> o_cocoaglview_container;
 
     msg_Dbg( p_vout, "Mac OS X Vout is closing" );
-    var_Destroy( p_vout, "drawable" );
+    var_Destroy( p_vout, "drawable-gl" );
 
     o_cocoaglview_container = [p_vout->p_sys->o_glview container];
 
diff --git a/modules/gui/minimal_macosx/voutagl.m b/modules/gui/minimal_macosx/voutagl.m
index 5554200..848dd0d 100644
--- a/modules/gui/minimal_macosx/voutagl.m
+++ b/modules/gui/minimal_macosx/voutagl.m
@@ -77,14 +77,15 @@ int aglInit( vout_thread_t * p_vout )
         msg_Err( p_vout, "Cannot create AGL context." );
         return VLC_EGENERIC;
     }
-    else {
+    else
+    {
         // tell opengl not to sync buffer swap with vertical retrace (too inefficient)
         GLint param = 0;
         aglSetInteger(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL, &param);
         aglEnable(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL);
     }
 
-    var_Get( p_vout->p_libvlc, "drawable", &val );
+    var_Get( p_vout->p_libvlc, "drawable-agl", &val );
     p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
     aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
 
@@ -123,7 +124,8 @@ int aglInit( vout_thread_t * p_vout )
 void aglEnd( vout_thread_t * p_vout )
 {
     aglSetCurrentContext(NULL);
-    if( p_vout->p_sys->theWindow ) DisposeWindow( p_vout->p_sys->theWindow );
+    if( p_vout->p_sys->theWindow )
+        DisposeWindow( p_vout->p_sys->theWindow );
     aglDestroyContext(p_vout->p_sys->agl_ctx);
 }
 
@@ -205,7 +207,7 @@ int aglManage( vout_thread_t * p_vout )
             Rect viewBounds;
             Rect clipBounds;
 
-            var_Get( p_vout->p_libvlc, "drawable", &val );
+            var_Get( p_vout->p_libvlc, "drawable-agl", &val );
             p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
             aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
 
diff --git a/modules/gui/minimal_macosx/voutgl.m b/modules/gui/minimal_macosx/voutgl.m
index c046268..c6334e9 100644
--- a/modules/gui/minimal_macosx/voutgl.m
+++ b/modules/gui/minimal_macosx/voutgl.m
@@ -36,7 +36,8 @@
 int OpenVideoGL  ( vlc_object_t * p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *) p_this;
-    vlc_value_t value_drawable;
+    int i_drawable_agl;
+    int i_drawable_gl;
 
     if( !CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ) )
     {
@@ -53,9 +54,11 @@ int OpenVideoGL  ( vlc_object_t * p_this )
 
     memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
-    var_Get( p_vout->p_libvlc, "drawable", &value_drawable );
- 
-    if( 0 /* Are we in the mozilla plugin ? XXX: get that from drawable */ )
+    i_drawable_agl = var_GetInteger( p_vout->p_libvlc, "drawable-agl" );
+    i_drawable_gl = var_GetInteger( p_vout->p_libvlc, "drawable-gl" );
+
+    /* Are we in the mozilla plugin ? */
+    if( i_drawable_agl > 0 )
     {
         p_vout->pf_init             = aglInit;
         p_vout->pf_end              = aglEnd;
@@ -65,7 +68,7 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         p_vout->pf_lock             = aglLock;
         p_vout->pf_unlock           = aglUnlock;
     }
-    else
+    else /*if( i_drawable_gl > 0 )*/
     {
         /* Let's use the VLCOpenGLVoutView.m class */
         p_vout->pf_init   = cocoaglvoutviewInit;




More information about the vlc-devel mailing list