[Mplayer-cvslog] CVS: main/libvo vo_fbdev.c,1.36,1.37

Szabolcs Berecz szabii at users.sourceforge.net
Sat Apr 28 22:39:27 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv8138

Modified Files:
	vo_fbdev.c 
Log Message:
some cleanups

Index: vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** vo_fbdev.c	2001/04/25 12:19:46	1.36
--- vo_fbdev.c	2001/04/28 20:39:25	1.37
***************
*** 21,38 ****
  #include <sys/ioctl.h>
  #include <linux/fb.h>
- #include <linux/vt.h>
  
  #include "config.h"
  #include "video_out.h"
  #include "video_out_internal.h"
! 
  #include "osd.h"
  #include "sub.h"
- 
  #include "yuv2rgb.h"
  extern void rgb15to16_mmx(char *s0, char *d0, int count);
  
- #include "fastmemcpy.h"
- 
  LIBVO_EXTERN(fbdev)
  
--- 21,34 ----
  #include <sys/ioctl.h>
  #include <linux/fb.h>
  
  #include "config.h"
  #include "video_out.h"
  #include "video_out_internal.h"
! #include "fastmemcpy.h"
  #include "osd.h"
  #include "sub.h"
  #include "yuv2rgb.h"
  extern void rgb15to16_mmx(char *s0, char *d0, int count);
  
  LIBVO_EXTERN(fbdev)
  
***************
*** 346,353 ****
  	int i;
  
! 	for (i = 0; i < nr_modes; i++) {
  		if (!strcmp(name, fb_modes[i].name))
  			return fb_modes + i;
- 	}
  	return NULL;
  }
--- 342,348 ----
  	int i;
  
! 	for (i = 0; i < nr_modes; i++)
  		if (!strcmp(name, fb_modes[i].name))
  			return fb_modes + i;
  	return NULL;
  }
***************
*** 377,384 ****
  static int in_range(range_t *r, float f)
  {
! 	for (/* NOTHING */; (r->min != -1 && r->max != -1); r++) {
  		if (f >= r->min && f <= r->max)
  			return 1;
- 	}
  	return 0;
  }
--- 372,378 ----
  static int in_range(range_t *r, float f)
  {
! 	for (/* NOTHING */; (r->min != -1 && r->max != -1); r++)
  		if (f >= r->min && f <= r->max)
  			return 1;
  	return 0;
  }
***************
*** 554,560 ****
  ******************************/
  
! /*
!  * command line/config file options
!  */
  char *fb_dev_name = NULL;
  char *fb_mode_cfgfile = "/etc/fb.modes";
--- 548,552 ----
  ******************************/
  
! /* command line/config file options */
  char *fb_dev_name = NULL;
  char *fb_mode_cfgfile = "/etc/fb.modes";
***************
*** 564,571 ****
--- 556,566 ----
  char *monitor_dotclock_str = NULL;
  
+ /* fb.modes related variables */
  range_t *monitor_hfreq = NULL;
  range_t *monitor_vfreq = NULL;
  range_t *monitor_dotclock = NULL;
+ static fb_mode_t *fb_mode = NULL;
  
+ /* vo_fbdev related variables */
  static int fb_preinit_done = 0;
  static int fb_works = 0;
***************
*** 573,577 ****
  static size_t fb_size;
  static uint8_t *frame_buffer;
! static uint8_t *L123123875;	/* thx to .so */
  static struct fb_fix_screeninfo fb_finfo;
  static struct fb_var_screeninfo fb_orig_vinfo;
--- 568,572 ----
  static size_t fb_size;
  static uint8_t *frame_buffer;
! static uint8_t *L123123875;	/* thx .so :) */
  static struct fb_fix_screeninfo fb_finfo;
  static struct fb_var_screeninfo fb_orig_vinfo;
***************
*** 584,588 ****
  static int fb_bpp_we_want;	// 32: 32  24: 24  16: 16  15: 15
  static int fb_screen_width;
! static fb_mode_t *fb_mode = NULL;
  
  static uint8_t *next_frame;
--- 579,585 ----
  static int fb_bpp_we_want;	// 32: 32  24: 24  16: 16  15: 15
  static int fb_screen_width;
! static void (*draw_alpha_p)(int w, int h, unsigned char *src,
! 		unsigned char *srca, int stride, unsigned char *dst,
! 		int dstride);
  
  static uint8_t *next_frame;
***************
*** 775,778 ****
--- 772,776 ----
  	}
  }
+ 
  static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
  		uint32_t d_height, uint32_t fullscreen, char *title,
***************
*** 803,810 ****
--- 801,810 ----
  		if (parse_fbmode_cfg(fb_mode_cfgfile) < 0)
  			return 1;
+ #if 0
  	if ((!d_width + !d_height) == 1) {
  		printf(FBDEV "use both -x and -y, or none of them\n");
  		return 1;
  	}
+ #endif
  	if (d_width) {
  		out_width = d_width;
***************
*** 936,939 ****
--- 936,956 ----
  	}
  
+ 	switch (fb_bpp) {
+ 	case 32:
+ 		draw_alpha_p = vo_draw_alpha_rgb32;
+ 		break;
+ 	case 24:
+ 		draw_alpha_p = vo_draw_alpha_rgb24;
+ 		break;
+ 	case 16:
+ 		draw_alpha_p = vo_draw_alpha_rgb16;
+ 		break;
+ 	case 15:
+ 		draw_alpha_p = vo_draw_alpha_rgb15;
+ 		break;
+ 	}
+ 	if (verbose > 1)
+ 		printf(FBDEV "draw_alpha_p:%dbpp = %p\n", fb_bpp, draw_alpha_p);
+ 
  	if (!(next_frame = (uint8_t *) malloc(in_width * in_height * fb_pixel_size))) {
  		printf(FBDEV "Can't malloc next_frame: %s\n", strerror(errno));
***************
*** 949,953 ****
  static uint32_t query_format(uint32_t format)
  {
! 	int ret = 0x4; /* osd/sub supported on all bpp */
  
  	if (!fb_preinit_done)
--- 966,970 ----
  static uint32_t query_format(uint32_t format)
  {
! 	int ret = 0x4; /* osd/sub is supported on every bpp */
  
  	if (!fb_preinit_done)
***************
*** 968,972 ****
  	}
  	if (format == IMGFMT_YV12)
! 		return ret|0x2;
  	return 0;
  }
--- 985,989 ----
  	}
  	if (format == IMGFMT_YV12)
! 		return ret|0x1;
  	return 0;
  }
***************
*** 980,1000 ****
  		unsigned char *srca, int stride)
  {
! 	uint8_t *dst = next_frame + (in_width * y0 + x0) * fb_pixel_size;
  	int dstride = in_width * fb_pixel_size;
  
! 	switch (fb_bpp) {
! 	case 24:
! 		vo_draw_alpha_rgb24(w, h, src, srca, stride, dst, dstride);
! 		break;
! 	case 32:
! 		vo_draw_alpha_rgb32(w, h, src, srca, stride, dst, dstride);
! 		break;
! 	case 15:
! 		vo_draw_alpha_rgb15(w, h, src, srca, stride, dst, dstride);
! 		break;
! 	case 16:
! 		vo_draw_alpha_rgb16(w, h, src, srca, stride, dst, dstride);
! 		break;
! 	}
  }
  
--- 997,1004 ----
  		unsigned char *srca, int stride)
  {
! 	unsigned char *dst = next_frame + (in_width * y0 + x0) * fb_pixel_size;
  	int dstride = in_width * fb_pixel_size;
  
! 	(*draw_alpha_p)(w, h, src, srca, stride, dst, dstride);
  }
  


_______________________________________________
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