[MPlayer-users] [Patch] moving the picture around the screen

Mark Zealey mark at zealos.org
Thu Aug 29 16:34:02 CEST 2002


I wrote a patch that lets you move the image around the screen so rather than
being in the top-left the whole time you can put it anywhere on the screen. At
the moment i have only changed the tdfx driver, but it is a very trivial change
to any other driver. You change the position by using a -xper and -yper and
giving it a percentage, eg -xper 100 -yper 0 would be top right. Patch is
attached, if people could review it, I'll then commit it to cvs or so.

-- 

Mark Zealey (aka JALH on irc.oftc.net: #zealos and many more)
mark at zealos.org; mark at itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a17! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ !w--- r++ !t---?@ !X---?  !R- !tv b+ G+++ e>+++++ !h++* r!-- y--
-------------- next part --------------
? tmp
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.161
diff -u -r1.161 cfg-mplayer.h
--- cfg-mplayer.h	22 Aug 2002 23:03:34 -0000	1.161
+++ cfg-mplayer.h	29 Aug 2002 14:11:28 -0000
@@ -224,6 +224,9 @@
 	// set screen dimensions (when not detectable or virtual!=visible)
 	{"screenw", &vo_screenwidth, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL},
 	{"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL},
+	// set position (percentage) of the image on the screen
+	{"xper", &vo_xper, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
+	{"yper", &vo_yper, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
 	// set aspect ratio of monitor - usefull for 16:9 TVout
 	{"monitoraspect", &monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL},
 	// video mode switching: (x11,xv,dga)
Index: libvo/video_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.c,v
retrieving revision 1.55
diff -u -r1.55 video_out.c
--- libvo/video_out.c	22 Aug 2002 23:03:50 -0000	1.55
+++ libvo/video_out.c	29 Aug 2002 14:11:29 -0000
@@ -38,6 +38,10 @@
 int vo_screenwidth=0;
 int vo_screenheight=0;
 
+// Position on the screen (in percentage points)
+int vo_xper = 0;
+int vo_yper = 0;
+
 int vo_config_count=0;
 
 // requested resolution/bpp:  (-x -y -bpp options)
Index: libvo/video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.41
diff -u -r1.41 video_out.h
--- libvo/video_out.h	28 Aug 2002 21:32:31 -0000	1.41
+++ libvo/video_out.h	29 Aug 2002 14:11:29 -0000
@@ -163,6 +163,8 @@
 extern int vo_screenwidth;
 extern int vo_screenheight;
 
+extern int vo_xper, vo_yper;
+
 // requested resolution/bpp:  (-x -y -bpp options)
 extern int vo_dx;
 extern int vo_dy;
Index: libvo/vo_tdfxfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_tdfxfb.c,v
retrieving revision 1.18
diff -u -r1.18 vo_tdfxfb.c
--- libvo/vo_tdfxfb.c	29 Aug 2002 12:04:02 -0000	1.18
+++ libvo/vo_tdfxfb.c	29 Aug 2002 14:11:29 -0000
@@ -192,7 +192,8 @@
 
 		vidwidth = r_width;
 		vidheight = r_height;
-		vidx = vidy = 0;
+		vidx = (screenwidth - vidwidth) * ((float)vo_xper / 100.0);
+		vidy = (screenheight - vidheight) * ((float)vo_yper / 100.0);
 	}
 
 	clear_screen();


More information about the MPlayer-users mailing list