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

Mika Pruikkonen mpruikko at cc.hut.fi
Mon May 10 20:00:38 CEST 2004


Hi,

this patch adds -geometry support for fbdev and fbdev2. It's
pretty neat to have a video in the top-right corner with
fbdev2 while hacking away at the console. :)

Regards,
  -mp
-------------- 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-10 15:19:24.645550272 +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 and fbdev.
 
 .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.649664096 +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.680659384 +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