[MPlayer-users] Problem about showing the movie at different position of the screen using fbdev

Mark Zealey mark at zealos.org
Wed Oct 9 00:08:01 CEST 2002


On Tue, Oct 08, 2002 at 09:48:31PM +0100, Glyn Kennington wrote:

> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Balatoni Denes wrote:
> > You can do mplayer -x 300 -y 200 to playce it anywhere you like.
> 
> Has this changed severely in the last day?  That doesn't quite match my
> understanding of
> 
>        -x <x> (MPLAYER only)
>               Scale image to x width (if sw/hw scaling available).  Disables aspect calcs.
> 
> (from man mplayer)

That's what I thought - as far as I know, no such methods exist - that's why I
wrote my own, unfortunalty these only work for vo tdfxfb but should be trivial
to port the changes to other drivers. Patch is attached.

-- 

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 --------------
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