diff options
-rw-r--r-- | cfg-mplayer.h | 2 | ||||
-rw-r--r-- | help_mp-en.h | 1 | ||||
-rw-r--r-- | libvo/vo_x11.c | 11 |
3 files changed, 13 insertions, 1 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h index ed76bdeb69..b2ba4b76cf 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -58,6 +58,7 @@ extern int ao_pcm_waveheader; #ifdef HAVE_X11 extern char *mDisplayName; +extern int WinID; #endif #ifdef HAVE_AA @@ -247,6 +248,7 @@ struct config conf[]={ {"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 diff --git a/help_mp-en.h b/help_mp-en.h index 3af356ca56..13c712abe8 100644 --- a/help_mp-en.h +++ b/help_mp-en.h @@ -43,6 +43,7 @@ static char help_text[]= " -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" diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index dfbc942a2c..6106c7a469 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -71,6 +71,9 @@ static XImage *myximage; 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 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d } #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 ); |