[vlc-commits] commit: osx: Add vout_window_t support to macosx vout module ( Juho Vähä-Herttua )

git at videolan.org git at videolan.org
Sun Jul 25 12:27:57 CEST 2010


vlc | branch: master | Juho Vähä-Herttua <juhovh at iki.fi> | Sat Jul 24 23:31:09 2010 +0300| [9c8ec0435b30445a3f9a16da2d80da69771665f8] | committer: Rémi Denis-Courmont 

osx: Add vout_window_t support to macosx vout module

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/video_output/macosx.m |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index c1571b3..5bacb08 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -98,6 +98,7 @@ struct vout_display_sys_t
     VLCOpenGLVideoView *glView;
     id<VLCOpenGLVideoViewEmbedding> container;
 
+    vout_window_t *embed;
     vout_opengl_t gl;
     vout_display_opengl_t vgl;
 
@@ -118,15 +119,35 @@ static int Open(vlc_object_t *this)
     vd->sys = sys;
     sys->pool = NULL;
     sys->gl.sys = NULL;
+    sys->embed = NULL;
 
     /* Get the drawable object */
     id container = var_CreateGetAddress(vd, "drawable-nsobject");
-    if (!container)
+    if (container)
     {
-        msg_Dbg(vd, "No drawable-nsobject, passing over.");
-        goto error;
+        vout_display_DeleteWindow(vd, NULL);
+    }
+    else
+    {
+        vout_window_cfg_t wnd_cfg;
+
+        memset (&wnd_cfg, 0, sizeof (wnd_cfg));
+        wnd_cfg.type = VOUT_WINDOW_TYPE_NSOBJECT;
+        wnd_cfg.x = var_InheritInteger (vd, "video-x");
+        wnd_cfg.y = var_InheritInteger (vd, "video-y");
+        wnd_cfg.width  = vd->cfg->display.width;
+        wnd_cfg.height = vd->cfg->display.height;
+
+        sys->embed = vout_display_NewWindow (vd, &wnd_cfg);
+        if (sys->embed)
+            container = sys->embed->handle.nsobject;
+
+        if (!container)
+        {
+            msg_Dbg(vd, "No drawable-nsobject nor vout_window_t found, passing over.");
+            goto error;
+        }
     }
-    vout_display_DeleteWindow(vd, NULL);
 
     /* This will be released in Close(), on
      * main thread, after we are done using it. */
@@ -220,6 +241,8 @@ void Close(vlc_object_t *this)
     if (sys->gl.sys != NULL)
         vout_display_opengl_Clean(&sys->vgl);
 
+    if (sys->embed)
+        vout_display_DeleteWindow(vd, sys->embed);
     free (sys);
 }
 



More information about the vlc-commits mailing list