changeset 3655:18cca6a6816c

Plugger patch by Sam Lin
author atmos4
date Sat, 22 Dec 2001 09:20:09 +0000
parents 33c3cff374a1
children f5c7158138ed
files cfg-mplayer.h help_mp-en.h libvo/vo_x11.c
diffstat 3 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mplayer.h	Sat Dec 22 00:55:58 2001 +0000
+++ b/cfg-mplayer.h	Sat Dec 22 09:20:09 2001 +0000
@@ -58,6 +58,7 @@
 
 #ifdef HAVE_X11
 extern char *mDisplayName;
+extern int WinID;
 #endif
 
 #ifdef HAVE_AA
@@ -247,6 +248,7 @@
 	{"softsleep", &softsleep, CONF_TYPE_FLAG, 0, 0, 1},
 
 	{"slave", &slave_mode, CONF_TYPE_FLAG, 0, 0, 1},
+	{"wid", &WinID, CONF_TYPE_INT, 0, 0, 0},
 
 
 #define MAIN_CONF
--- a/help_mp-en.h	Sat Dec 22 00:55:58 2001 +0000
+++ b/help_mp-en.h	Sat Dec 22 09:20:09 2001 +0000
@@ -43,6 +43,7 @@
 " -pp <quality>   enable postprocessing filter (0-4 for DivX, 0-63 for mpegs)\n"
 " -nobps          use alternative A-V sync method for AVI files (may help!)\n"
 " -framedrop      enable frame-dropping (for slow machines)\n"
+" -wid <window id> use existing window for video output (useful with plugger!)\n"
 "\n"
 "Keys:\n"
 " <-  or  ->      seek backward/forward 10 seconds\n"
--- a/libvo/vo_x11.c	Sat Dec 22 00:55:58 2001 +0000
+++ b/libvo/vo_x11.c	Sat Dec 22 09:20:09 2001 +0000
@@ -71,6 +71,9 @@
 static int depth,bpp,mode;
 static XWindowAttributes attribs;
 
+/* output window id */
+int WinID=0;
+
 //static int vo_dwidth,vo_dheight;
 
 static int Flip_Flag;
@@ -281,7 +284,13 @@
      }
 #endif
  
-    mywindow=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ),
+    if ( WinID ){
+      mywindow = (Window)WinID;
+      XUnmapWindow( mDisplay,mywindow );
+      XChangeWindowAttributes( mDisplay,mywindow,xswamask,&xswa );
+    }
+    else
+      mywindow=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ),
                          hint.x,hint.y,
                          hint.width,hint.height,
                          xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );