[MPlayer-dev-eng] -geometry option - patch for fbdev
Balatoni Denes
pnis at coder.hu
Wed Oct 23 15:35:13 CEST 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
Here is the geometry patch for fbdev.
I couldn't test it yet, hopefully there is no typo.
bye
Denes
> xper and yper are not needed - a reminant from my previous patch that I
> forgot to remove. the geometry.* files go in libvo - I couldnt get cvs to
> just have them added via patch without adding them to the repo... silly
> cvs;) Please send me the fbdev patches so i can update as the patch is
> updated and then merged in.
- --
"Use the source Luke !"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD4DBQE9tqWRaQToeq3jgogRAmmnAJ91JZDNfOa7Ix/SziYy4xTKaa/sHgCVEraR
EPzibAuoH76Q7GaFw38BdQ==
=UPj0
-----END PGP SIGNATURE-----
-------------- next part --------------
--- libvo/vo_fbdev.c Wed Oct 9 02:52:15 2002
+++ libvo/vo_fbdev.c Wed Oct 23 15:30:10 2002
@@ -1037,12 +1037,14 @@
image_width=width;
image_height=height;
}
- if(fb_xres > image_width)
+/* if(fb_xres > image_width)
x_offset = (fb_xres - image_width) / 2;
else x_offset = 0;
if(fb_yres > image_height)
y_offset = (fb_yres - image_height) / 2;
- else y_offset = 0;
+ else y_offset = 0;*/
+ geometry(&x_offset,&y_offset,fb_xres,fb_yres,image_width,image_height);
+
if(vidix_init(width,height,x_offset,y_offset,image_width,
image_height,format,fb_bpp,
fb_xres,fb_yres) != 0)
@@ -1058,13 +1060,18 @@
else
#endif
{
+ int x_offset,y_offset;
if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
printf(FBDEV "Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
return 1;
}
+
+ geometry(&x_offset,&y_offset,fb_xres,fb_yres,out_width,out_height);
+
L123123875 = frame_buffer + (out_width - in_width) * fb_pixel_size /
- 2 + (out_height - in_height) * fb_line_len / 2;
+ 2 + (out_height - in_height) * fb_line_len / 2 +
+ x_offset * fb_pixel_size + y_offset * fb_line_len;
if (verbose > 0) {
if (verbose > 1) {
More information about the MPlayer-dev-eng
mailing list