Mercurial > mplayer.hg
diff libvo/vo_fbdev.c @ 7866:732a8bfc7681
Added the -geometry option (supports fbdev and tdfxfb drivers)
author | mark |
---|---|
date | Wed, 23 Oct 2002 16:52:54 +0000 |
parents | 45d64e3fa09a |
children | b890315b36d7 |
line wrap: on
line diff
--- a/libvo/vo_fbdev.c Wed Oct 23 15:49:44 2002 +0000 +++ b/libvo/vo_fbdev.c Wed Oct 23 16:52:54 2002 +0000 @@ -1037,12 +1037,8 @@ image_width=width; image_height=height; } - 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; + 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 +1054,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) / 2 ) * fb_line_len; + 2 + ( (out_height - in_height) / 2 ) * fb_line_len + + x_offset * fb_pixel_size + y_offset * fb_line_len; if (verbose > 0) { if (verbose > 1) {