[Mplayer-cvslog] CVS: main/libvo vo_fbdev.c,1.8,1.9
Szabolcs Berecz
szabii at users.sourceforge.net
Tue Apr 3 22:35:55 CEST 2001
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv12176
Modified Files:
vo_fbdev.c
Log Message:
now it works in 15bpp mode
Index: vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** vo_fbdev.c 2001/04/03 14:03:51 1.8
--- vo_fbdev.c 2001/04/03 20:35:46 1.9
***************
*** 35,38 ****
--- 35,39 ----
static size_t fb_size;
static uint8_t *frame_buffer;
+ static int fb_pixel_size;
static int fb_bpp;
struct fb_fix_screeninfo fb_fix_info;
***************
*** 163,167 ****
}
! fb_bpp = fb_var_info.bits_per_pixel;
screen_width = fb_fix_info.line_length;
fb_size = fb_fix_info.smem_len;
--- 164,170 ----
}
! fb_pixel_size = fb_var_info.bits_per_pixel / 8;
! fb_bpp = fb_var_info.red.length + fb_var_info.green.length +
! fb_var_info.blue.length;
screen_width = fb_fix_info.line_length;
fb_size = fb_fix_info.smem_len;
***************
*** 175,179 ****
printf("fb_init: framebuffer size: %d bytes\n", fb_size);
printf("fb_init: bpp: %d\n", fb_bpp);
! printf("fb_init: pixel per line: %d\n", screen_width / (fb_bpp / 8));
printf("fb_init: visual: %d\n", fb_fix_info.visual);
printf("fb_init: red: %d %d %d\n", fb_var_info.red.offset,
--- 178,183 ----
printf("fb_init: framebuffer size: %d bytes\n", fb_size);
printf("fb_init: bpp: %d\n", fb_bpp);
! printf("fb_init: pixel size: %d\n", fb_pixel_size);
! printf("fb_init: pixel per line: %d\n", screen_width / fb_pixel_size);
printf("fb_init: visual: %d\n", fb_fix_info.visual);
printf("fb_init: red: %d %d %d\n", fb_var_info.red.offset,
***************
*** 201,205 ****
out_height = height;
pixel_format = format;
! if (!(next_frame = (uint8_t *) malloc(in_width * in_height * (fb_bpp / 8)))) {
printf("Can't malloc next_frame: %s\n", strerror(errno));
return 1;
--- 205,209 ----
out_height = height;
pixel_format = format;
! if (!(next_frame = (uint8_t *) malloc(in_width * in_height * fb_pixel_size))) {
printf("Can't malloc next_frame: %s\n", strerror(errno));
return 1;
***************
*** 207,211 ****
if (format == IMGFMT_YV12)
! yuv2rgb_init(fb_bpp, MODE_RGB);
return 0;
}
--- 211,216 ----
if (format == IMGFMT_YV12)
! // yuv2rgb_init(fb_pixel_size * 8, MODE_RGB);
! yuv2rgb_init((fb_pixel_size == 4) ? 32 : fb_bpp, MODE_RGB);
return 0;
}
***************
*** 216,220 ****
if (fb_init())
return 0;
! printf("vo_fbdev: query_format(%#x): ", format);
// if (format & IMGFMT_BGR_MASK == IMGFMT_BGR)
// goto not_supported;
--- 221,225 ----
if (fb_init())
return 0;
! printf("vo_fbdev: query_format(%#x(%.4s)): ", format, &format);
// if (format & IMGFMT_BGR_MASK == IMGFMT_BGR)
// goto not_supported;
***************
*** 241,249 ****
*/
case IMGFMT_BGR|32:
! if (fb_bpp == 32)
goto supported;
break;
case IMGFMT_BGR|24:
! if (fb_bpp == 24)
goto supported;
break;
--- 246,254 ----
*/
case IMGFMT_BGR|32:
! if (fb_bpp == 24 && fb_pixel_size == 4)
goto supported;
break;
case IMGFMT_BGR|24:
! if (fb_bpp == 24 && fb_pixel_size == 3)
goto supported;
break;
***************
*** 278,282 ****
if (pixel_format == IMGFMT_YV12) {
for (y = 0; y < h; y++){
! dst = next_frame + (in_width * (y0 + y) + x0) * (fb_bpp / 8);
for (x = 0; x < w; x++) {
if (srca[x]) {
--- 283,287 ----
if (pixel_format == IMGFMT_YV12) {
for (y = 0; y < h; y++){
! dst = next_frame + (in_width * (y0 + y) + x0) * fb_pixel_size;
for (x = 0; x < w; x++) {
if (srca[x]) {
***************
*** 285,289 ****
dst[2]=((dst[2]*srca[x])>>8)+src[x];
}
! dst += fb_bpp / 8;
}
src += stride;
--- 290,294 ----
dst[2]=((dst[2]*srca[x])>>8)+src[x];
}
! dst += fb_pixel_size;
}
src += stride;
***************
*** 297,304 ****
if (pixel_format == IMGFMT_YV12) {
yuv2rgb(next_frame, src[0], src[1], src[2], in_width,
! in_height, in_width * (fb_bpp / 8),
in_width, in_width / 2);
} else if ((pixel_format & IMGFMT_BGR_MASK) == IMGFMT_BGR) {
! memcpy(next_frame, src[0], in_width * in_height * (fb_bpp / 8));
} else if ((pixel_format & IMGFMT_RGB_MASK) == IMGFMT_RGB) {
}
--- 302,309 ----
if (pixel_format == IMGFMT_YV12) {
yuv2rgb(next_frame, src[0], src[1], src[2], in_width,
! in_height, in_width * fb_pixel_size,
in_width, in_width / 2);
} else if ((pixel_format & IMGFMT_BGR_MASK) == IMGFMT_BGR) {
! memcpy(next_frame, src[0], in_width * in_height * fb_pixel_size);
} else if ((pixel_format & IMGFMT_RGB_MASK) == IMGFMT_RGB) {
}
***************
*** 311,316 ****
uint8_t *dest;
! dest = next_frame + (in_width * y + x) * (fb_bpp / 8);
! yuv2rgb(dest, src[0], src[1], src[2], w, h, in_width * (fb_bpp / 8),
stride[0], stride[1]);
return 0;
--- 316,321 ----
uint8_t *dest;
! dest = next_frame + (in_width * y + x) * fb_pixel_size;
! yuv2rgb(dest, src[0], src[1], src[2], w, h, in_width * fb_pixel_size,
stride[0], stride[1]);
return 0;
***************
*** 327,333 ****
for (i = 0; i < in_height; i++) {
memcpy(frame_buffer + out_offset, next_frame + in_offset,
! in_width * (fb_bpp / 8));
out_offset += screen_width;
! in_offset += in_width * (fb_bpp / 8);
}
}
--- 332,338 ----
for (i = 0; i < in_height; i++) {
memcpy(frame_buffer + out_offset, next_frame + in_offset,
! in_width * fb_pixel_size);
out_offset += screen_width;
! in_offset += in_width * fb_pixel_size;
}
}
***************
*** 348,352 ****
printf("vo_fbdev: Can't set virtual screensize to original value: %s\n", strerror(errno));
close(fb_dev_fd);
! memset(next_frame, '\0', in_height * in_width * (fb_bpp / 8));
put_frame();
if (vt_active >= 0)
--- 353,357 ----
printf("vo_fbdev: Can't set virtual screensize to original value: %s\n", strerror(errno));
close(fb_dev_fd);
! memset(next_frame, '\0', in_height * in_width * fb_pixel_size);
put_frame();
if (vt_active >= 0)
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list