[Mplayer-dev-eng] patch for play video over XV in root window

Konir Tomas moje at molly.vabo.cz
Wed Jun 20 00:51:25 CEST 2001


On Wed, 20 Jun 2001, [iso-8859-1] André Dahlqvist wrote:

> Konir Tomas <moje at molly.vabo.cz> wrote:
>
> > I'm using mplayer and it's very well. Me and any my friends want to have
> > video in root window as walpaper. I wrote small patch. I'm sorry if you
> > dislike it, but i think that it's not bad idea. Please excuse my bad
> > english.
>
> How about including the patch?:-) Btw, I can do this with fvwm without any
> patch. All one needs to do is specify that the mplayer window shouln't have
> any decorations.
>

Sorry, i forgot to include the patch. I'l do it now.
And in my windowmanager (icewm) i can't make window without decorations
or i don't know how.

-- 

Tomas Konir
Student
Brno

ICQ 25849167

and here is the short patch:

--- main/cfg-mplayer.h	Sun Jun 17 22:38:01 2001
+++ main/cfg-mplayer.h	Tue Jun 19 21:55:14 2001
@@ -151,6 +151,7 @@
 	{"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0},
         {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1},
         {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0},
+	{"root", &play_in_root_window, CONF_TYPE_FLAG, 0, 0, 1},
         {"flip", &flip, CONF_TYPE_FLAG, 0, -1, 1},
         {"noflip", &flip, CONF_TYPE_FLAG, 0, -1, 0},

--- main/mplayer.c	Mon Jun 18 16:19:13 2001
+++ main/mplayer.c	Tue Jun 19 21:51:39 2001
@@ -348,6 +348,7 @@
 int fullscreen=0;
 int vidmode=0;
 int softzoom=0;
+int play_in_root_window=0;
 int flip=-1;
 int screen_size_x=0;//SCREEN_SIZE_X;
 int screen_size_y=0;//SCREEN_SIZE_Y;
@@ -1337,7 +1338,7 @@
    if(verbose) printf("video_out->init(%dx%d->%dx%d,flags=%d,'%s',0x%X)\n",
                       sh_video->disp_w,sh_video->disp_h,
                       screen_size_x,screen_size_y,
-                      fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
+                      fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3)|(play_in_root_window<<4),
                       title,out_fmt);

 if(verbose) printf("vo_debug3: out_fmt=0x%08X\n",out_fmt);
@@ -1353,7 +1354,7 @@

    if(video_out->init(sh_video->disp_w,sh_video->disp_h,
                       screen_size_x,screen_size_y,
-                      fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
+                      fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3)|(play_in_root_window<<4),
                       title,out_fmt)){
      printf("FATAL: Cannot initialize video driver!\n");
      GUI_MSG( mplCantInitVideoDriver )
--- main/mplayer.h	Mon Jun  4 20:41:34 2001
+++ main/mplayer.h	Tue Jun 19 21:31:44 2001
@@ -46,6 +46,7 @@
 extern int fullscreen;
 extern int vidmode;
 extern int softzoom;
+extern int play_in_root_window;
 extern int screen_size_x;//SCREEN_SIZE_X;
 extern int screen_size_y;//SCREEN_SIZE_Y;
 extern int screen_size_xy;
--- main/libvo/vo_xv.c	Sun Jun 17 03:22:09 2001
+++ main/libvo/vo_xv.c	Wed Jun 20 00:45:11 2001
@@ -111,6 +111,7 @@
  image_format=format;

  mFullscreen=flags&1;
+ mRoot=flags&16;
  dwidth=d_width; dheight=d_height;

  if (!vo_init()) return -1;
@@ -138,11 +139,16 @@
    xswa.border_pixel     = 0;
    xswamask = CWBackPixel | CWBorderPixel;

-   mywindow = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen),
-   hint.x, hint.y, hint.width, hint.height,
-   0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+    if(!mRoot){
+	  mywindow = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen),
+			   hint.x, hint.y, hint.width, hint.height,
+			0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+	    vo_hidecursor(mDisplay,mywindow);
+	    }
+    else{
+	 mywindow = RootWindow(mDisplay,mScreen);
+	 }
    vo_x11_classhint( mDisplay,mywindow,"xv" );
-   vo_hidecursor(mDisplay,mywindow);

    XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask );
    XSetStandardProperties(mDisplay, mywindow, hello, hello, None, NULL, 0, &hint);


_______________________________________________
Mplayer-dev-eng mailing list
Mplayer-dev-eng at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list