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

Mika Pruikkonen mpruikko at cc.hut.fi
Fri Jul 23 13:41:14 CEST 2004


On Thu, Jul 22, 2004 at 06:50:40PM -0500, Joey Parrish wrote:
> It's no longer in my inbox, sorry.  Plus, I'm not the fbdev maintainer.
> I just tried to clean up fbdev, which is how fbdev2 happened.  Repost
> the patch (sorry) and I'll look at it.

Here it is. The subject line was a bit misleading, this adds the 
support for both fbdev and fbdev2, and it's actually more useful
with fbdev2, since you can use it to place a video to the right
side of the screen while working at the console.

Regards,
  -mp


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