[MPlayer-dev-eng] [PATCH] Add -geometry support for fbdev

Mika Pruikkonen mpruikko at cc.hut.fi
Tue May 11 18:32:11 CEST 2004


Diego Biurrun wrote:
> Nice, but your man page update should mention both vo drivers then:

I guess I was trying to keep the vo list short, but yeah, it's
probably better to explicitly mention all drivers. New patch
attached.
-------------- next part --------------
diff -Nur main/DOCS/man/en/mplayer.1 main.patch/DOCS/man/en/mplayer.1
--- main/DOCS/man/en/mplayer.1	2004-05-05 19:30:32.000000000 +0300
+++ main.patch/DOCS/man/en/mplayer.1	2004-05-11 19:05:13.409028656 +0300
@@ -1769,7 +1769,7 @@
 .br
 .I NOTE:
 This option is only supported by vo x11, xmga, xv, xvmc, xvidix,
-directx and tdfxfb.
+directx, tdfxfb, fbdev and fbdev2.
 
 .I EXAMPLE:
 .PD 0
diff -Nur main/libvo/vo_fbdev.c main.patch/libvo/vo_fbdev.c
--- main/libvo/vo_fbdev.c	2004-01-10 11:48:14.000000000 +0200
+++ main.patch/libvo/vo_fbdev.c	2004-05-10 15:17:38.000000000 +0300
@@ -1005,6 +1005,8 @@
 		return 1;
 	    }
 
+	    geometry(&x_offset, &y_offset, &out_width, &out_height, fb_xres, fb_yres);
+
 	    center = frame_buffer + (out_width - in_width) * fb_pixel_size /
 		    2 + ( (out_height - in_height) / 2 ) * fb_line_len +
 		    x_offset * fb_pixel_size + y_offset * fb_line_len;
diff -Nur main/libvo/vo_fbdev2.c main.patch/libvo/vo_fbdev2.c
--- main/libvo/vo_fbdev2.c	2004-01-10 11:48:14.000000000 +0200
+++ main.patch/libvo/vo_fbdev2.c	2004-05-10 15:17:38.000000000 +0300
@@ -210,6 +210,7 @@
 {
 	struct fb_cmap *cmap;
 	int fs = flags & 0x01;
+	int x_offset = 0, y_offset = 0;
 
 	out_width = width;
 	out_height = height;
@@ -280,8 +281,11 @@
 		}
 	}
 
+	geometry(&x_offset, &y_offset, &out_width, &out_height, fb_vinfo.xres, fb_vinfo.yres);
+
 	center = frame_buffer + (out_width - in_width) * fb_pixel_size /
-		2 + ( (out_height - in_height) / 2 ) * fb_line_len;
+		2 + ( (out_height - in_height) / 2 ) * fb_line_len +
+		x_offset * fb_pixel_size + y_offset * fb_line_len;
 
 #ifndef USE_CONVERT2FB
 	if (!(next_frame = (uint8_t *) realloc(next_frame, in_width * in_height * fb_pixel_size))) {


More information about the MPlayer-dev-eng mailing list