Mercurial > mplayer.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
7865:d151608b9f28 | 7866:732a8bfc7681 |
---|---|
1035 aspect(&image_width,&image_height,fs ? A_ZOOM : A_NOZOOM); | 1035 aspect(&image_width,&image_height,fs ? A_ZOOM : A_NOZOOM); |
1036 } else { | 1036 } else { |
1037 image_width=width; | 1037 image_width=width; |
1038 image_height=height; | 1038 image_height=height; |
1039 } | 1039 } |
1040 if(fb_xres > image_width) | 1040 geometry(&x_offset,&y_offset,fb_xres,fb_yres,image_width,image_height); |
1041 x_offset = (fb_xres - image_width) / 2; | 1041 |
1042 else x_offset = 0; | |
1043 if(fb_yres > image_height) | |
1044 y_offset = (fb_yres - image_height) / 2; | |
1045 else y_offset = 0; | |
1046 if(vidix_init(width,height,x_offset,y_offset,image_width, | 1042 if(vidix_init(width,height,x_offset,y_offset,image_width, |
1047 image_height,format,fb_bpp, | 1043 image_height,format,fb_bpp, |
1048 fb_xres,fb_yres) != 0) | 1044 fb_xres,fb_yres) != 0) |
1049 { | 1045 { |
1050 printf(FBDEV "Can't initialize VIDIX driver\n"); | 1046 printf(FBDEV "Can't initialize VIDIX driver\n"); |
1056 vidix_start(); | 1052 vidix_start(); |
1057 } | 1053 } |
1058 else | 1054 else |
1059 #endif | 1055 #endif |
1060 { | 1056 { |
1057 int x_offset,y_offset; | |
1061 if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE, | 1058 if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE, |
1062 MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) { | 1059 MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) { |
1063 printf(FBDEV "Can't mmap %s: %s\n", fb_dev_name, strerror(errno)); | 1060 printf(FBDEV "Can't mmap %s: %s\n", fb_dev_name, strerror(errno)); |
1064 return 1; | 1061 return 1; |
1065 } | 1062 } |
1063 | |
1064 geometry(&x_offset,&y_offset,fb_xres,fb_yres,out_width,out_height); | |
1065 | |
1066 L123123875 = frame_buffer + (out_width - in_width) * fb_pixel_size / | 1066 L123123875 = frame_buffer + (out_width - in_width) * fb_pixel_size / |
1067 2 + ( (out_height - in_height) / 2 ) * fb_line_len; | 1067 2 + ( (out_height - in_height) / 2 ) * fb_line_len + |
1068 x_offset * fb_pixel_size + y_offset * fb_line_len; | |
1068 | 1069 |
1069 if (verbose > 0) { | 1070 if (verbose > 0) { |
1070 if (verbose > 1) { | 1071 if (verbose > 1) { |
1071 printf(FBDEV "frame_buffer @ %p\n", frame_buffer); | 1072 printf(FBDEV "frame_buffer @ %p\n", frame_buffer); |
1072 printf(FBDEV "L123123875 @ %p\n", L123123875); | 1073 printf(FBDEV "L123123875 @ %p\n", L123123875); |