[MPlayer-dev-eng] Re: [PATCH][PREVIEW] -wid fullscreen switching (Fabian Franz)

Markus Rechberger mrechberger at web.de
Fri Aug 15 18:47:11 CEST 2003


hey,

can you please wait till you apply this patch? My mozilla plugin works 
very close with this feature maybe it will need some input related changes.
how about passing 2 window IDs to mplayer?
-wid 0x[targetwindow]
-widfs 0x[fullscreenwindow] so that the code which embeds mplayer has 
full control about it's fullscreenwindow.

right now I work on a bidirectional communication interface for mplayer 
without manipulating mplayer's source (just pipes and a 
helperapplication that grabs the output of mplayer)

problems:
mplayer crashes on high quality quicktime movies when I use this feature 
to embed it in a plugin window. it never crashes when I play wmv files 
from mp4.com ..  (don't take this too serious mplayer doesn't crash when 
playing it normal mode I'll do some more research on that later)


Markus

>   4. [PATCH][PREVIEW] -wid fullscreen switching (Fabian Franz)
>
>  
>
>=2D----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi,
>
>attached is a fixed version, which does use only one static global var more=
>,=20
>which is really necessary.
>
>It does work, but hm, imho its not a nice clean solution / code yet.
>
>Also gui needs to be enhanced too, which is not so easy - at least for me .=
>=2E.
>
>How to test:
>
>Apply, compile ;)
>
>xterm &
>xwininfo -tree
>
>click on xterm, use the second hex-Id you get :
>
>use ./mplayer -wid the-hex-id some-movie....
>
>It should play in the xterm window :-)
>
>Then you can move mouse about it, and press f to go to fullscreen mode ...
>
>cu
>
>=46abian
>
>PS: Please test, if possible.
>=2D----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.0 (GNU/Linux)
>
>iD8DBQE/PP89I0lSH7CXz7MRAvlFAJ98qy5gcPxXVW/bMM0EvKOrgyQTKgCeJI+C
>pKWE9vXSFsMLme90V73ojIA=3D
>=3DdL5h
>=2D----END PGP SIGNATURE-----
>
>--Boundary-00=_68PP/3xAlss2UgL
>Content-Type: text/x-diff;
>  charset="us-ascii";
>  name="widpatchv3.diff"
>Content-Transfer-Encoding: 7bit
>Content-Disposition: attachment; filename="widpatchv3.diff"
>
>Index: libvo/x11_common.c
>===================================================================
>RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
>retrieving revision 1.149
>diff -u -r1.149 x11_common.c
>--- libvo/x11_common.c	12 Aug 2003 20:54:12 -0000	1.149
>+++ libvo/x11_common.c	15 Aug 2003 15:44:56 -0000
>@@ -594,6 +594,7 @@
> }
> 
> Window     vo_window = None;
>+static Window     vo_spawnwindow = None;
> GC         vo_gc = NULL;
> XSizeHints vo_hint;
> 
>@@ -625,8 +626,13 @@
> 	    XUnmapWindow( mDisplay,vo_window );
> 	    XDestroyWindow(mDisplay, vo_window);
> 	    do { XNextEvent( mDisplay,&xev ); } while ( xev.type != DestroyNotify || xev.xdestroywindow.event != vo_window );
>+	  } else {
>+	    XUnmapWindow(mDisplay,vo_spawnwindow);
>+            XDestroyWindow(mDisplay,vo_spawnwindow);
> 	  }
>+
> 	  vo_window=None;
>+
> 	}
> 	vo_fs=0;
> 	vo_old_width=vo_old_height=0;
>@@ -878,26 +884,60 @@
> void vo_x11_fullscreen( void )
> {
>  int x,y,w,h;
>+ Window     vo_backupwindow = None;
> 
>- if ( WinID >= 0 ) return;
>-
>+ //if ( WinID>=0 && !wid_fs_valid ) return;
>+ 
>  if ( vo_fs ){
>-   // fs->win
>-   if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return;
>-   vo_fs=VO_FALSE;
>-   x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height;
>+   // fullscreen -> window
>+   if(WinID>=0){
>+     XUnmapWindow(mDisplay,vo_window);
>+     vo_backupwindow=vo_spawnwindow;
>+     vo_spawnwindow=vo_window;
>+     vo_window=vo_backupwindow;
>+     XMapWindow(mDisplay,vo_window);
>+     vo_old_x=0;
>+     vo_old_y=0;
>+     vo_fs=VO_FALSE;
>+     x=0; y=0; w=vo_old_width; h=vo_old_height;
>+     vo_dheight=vo_old_height;
>+     vo_dwidth=vo_old_width;
>+     XSelectInput(mDisplay,vo_window,ExposureMask|KeyPressMask|PointerMotionMask); 
>+   } else {
>+     if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return;
>+     vo_fs=VO_FALSE;
>+     x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height;
>+   }
>+  
>  } else {
>-   // win->fs
>-   if(vo_old_width && 
>-     (vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) &&
>-     (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return;
>-   vo_fs=VO_TRUE;
>-   vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight;
>-   x=0; y=0; w=vo_screenwidth; h=vo_screenheight;
>+   // window -> fullscreen
>+   if(WinID >= 0){
>+     if (vo_spawnwindow==None)
>+       vo_spawnwindow=XCreateWindow(mDisplay,mRootWin, 0,0,vo_screenwidth,vo_screenheight,0,0,0,0,0,0);
>+     vo_backupwindow=vo_window;
>+     vo_window=vo_spawnwindow;
>+     vo_spawnwindow=vo_backupwindow;
>+     XSelectInput(mDisplay, vo_window, ExposureMask|KeyPressMask|PointerMotionMask); 
>+     //ButtonPressMask|KeyPressMask|PointerMotionMask|ButtonReleaseMask);
>+     vo_fs=VO_TRUE;
>+     vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight;
>+     x=0; y=0; w=vo_screenwidth; h=vo_screenheight;
>+     vo_dheight=vo_screenheight;
>+     vo_dwidth=vo_screenwidth;
>+   } else {
>+     if(vo_old_width && 
>+       (vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) &&
>+       (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return;
>+     vo_fs=VO_TRUE;
>+     vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight;
>+     x=0; y=0; w=vo_screenwidth; h=vo_screenheight;
>+   }
>  }
>  vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 0 : 1 );
>- vo_x11_sizehint( x,y,w,h,0 );
>- vo_x11_setlayer( mDisplay,vo_window,vo_fs );
>+ if(WinID<0){
>+   vo_x11_sizehint( x,y,w,h,0 );
>+   vo_x11_setlayer( mDisplay,vo_window,vo_fs );
>+ }
>  if(vo_wm_type==0 && !(vo_fsmode&16))
> //    XUnmapWindow( mDisplay,vo_window );  // required for MWM
>       XWithdrawWindow(mDisplay,vo_window,mScreen);
>
>--Boundary-00=_68PP/3xAlss2UgL--
>  
>




More information about the MPlayer-dev-eng mailing list