[Mplayer-cvslog] CVS: main/libvo vesa_lvo.c,1.4,1.5 vesa_lvo.h,1.1,1.2 vo_vesa.c,1.48,1.49

Nick Kurshev nick at mplayer.dev.hu
Sun Nov 18 16:06:34 CET 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv2696/main/libvo

Modified Files:
	vesa_lvo.c vesa_lvo.h vo_vesa.c 
Log Message:
Added preinit of lvo stuff

Index: vesa_lvo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vesa_lvo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vesa_lvo.c	18 Nov 2001 09:45:29 -0000	1.4
+++ vesa_lvo.c	18 Nov 2001 15:06:32 -0000	1.5
@@ -40,17 +40,22 @@
 #define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
 #define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size))
 
-int      vlvo_init(const char *drvname,unsigned src_width,unsigned src_height,
-		   unsigned x_org,unsigned y_org,unsigned dst_width,
-		   unsigned dst_height,unsigned format,unsigned dest_bpp)
+int vlvo_preinit(const char *drvname)
 {
-  size_t i,awidth;
 	lvo_handler = open(drvname,O_RDWR);
 	if(lvo_handler == -1)
 	{
-		printf("Couldn't open %s\n",drvname);
+		printf("vesa_lvo: Couldn't open '%s'\n",drvname);
 		return -1;
 	}
+	return 0;
+}
+
+int      vlvo_init(unsigned src_width,unsigned src_height,
+		   unsigned x_org,unsigned y_org,unsigned dst_width,
+		   unsigned dst_height,unsigned format,unsigned dest_bpp)
+{
+  size_t i,awidth;
 	image_width = src_width;
 	image_height = src_height;
 	mga_vid_config.version=MGA_VID_VERSION;
@@ -99,8 +104,8 @@
 	mga_vid_config.num_frames=NUM_FRAMES;
 	if (ioctl(lvo_handler,MGA_VID_CONFIG,&mga_vid_config))
 	{
-		perror("Error in mga_vid_config ioctl()");
-                printf("Your mga_vid driver version is incompatible with this MPlayer version!\n");
+		perror("vesa_lvo: Error in mga_vid_config ioctl()");
+                printf("vesa_lvo: Your fb_vid driver version is incompatible with this MPlayer version!\n");
 		return -1;
 	}
 	ioctl(lvo_handler,MGA_VID_ON,0);

Index: vesa_lvo.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vesa_lvo.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vesa_lvo.h	13 Nov 2001 17:13:33 -0000	1.1
+++ vesa_lvo.h	18 Nov 2001 15:06:32 -0000	1.2
@@ -11,8 +11,9 @@
 
 #ifndef __VESA_LVO_INCLUDED
 #define __VESA_LVO_INCLUDED
-
-int      vlvo_init(const char *drvname,unsigned src_width,unsigned src_height,
+
+int	 vlvo_preinit(
const char *drvname);
+int      vlvo_init(unsigned src_width,unsigned src_height,
 		   unsigned x_org,unsigned y_org,unsigned dst_width,
 		   unsigned dst_height,unsigned format,unsigned dest_bpp);
 void     vlvo_term( void );

Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- vo_vesa.c	18 Nov 2001 09:46:11 -0000	1.48
+++ vo_vesa.c	18 Nov 2001 15:06:32 -0000	1.49
@@ -98,6 +98,7 @@
 
 /* Linux Video Overlay */
 static const char *lvo_name = NULL;
+static int pre_init_err = 0;
 
 #define HAS_DGA()  (win.idx == -1)
 #define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS)
@@ -412,14 +413,23 @@
    return flags;
 }
 
-
 static uint32_t query_format(uint32_t format)
 {
+  static int first = 1;
   uint32_t retval;
     if(verbose > 2)
         printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
-    if(vo_subdevice) parseSubDevice(vo_subdevice);
-    if(lvo_name) return 1;
+    if(first)
+    {
+      if(verbose > 2)
+        printf("vo_vesa: subdevice %s have been initialized\n",vo_subdevice);
+      if(vo_subdevice) parseSubDevice(vo_subdevice);
+      if(lvo_name) pre_init_err = vlvo_preinit(lvo_name);
+      if(verbose > 2)
+        printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
+      first = 0;
+    }
+    if(!pre_init_err && lvo_name) return vlvo_query_info(format);
 	switch(format)
 	{
 		case IMGFMT_YV12:
@@ -543,6 +553,11 @@
 	fs_mode = 0;
 	rgb2rgb_fnc = NULL;
         sd_flags = 0;
+	if(pre_init_err)
+	{
+	  printf("vo_vesa: initialization have been terminated due wrong preinitialization\n");
+	  return -1;
+	}  
         if(vo_subdevice) sd_flags = parseSubDevice(vo_subdevice);
 	if(sd_flags == -1) return -1;
 	if(flags & 0x8)
@@ -850,7 +865,7 @@
 		}
 		if(lvo_name)
 		{
-		  if(vlvo_init(lvo_name,width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0)
+		  if(vlvo_init(width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0)
 		  {
 		    printf("vo_vesa: Can't initialize Linux Video Overlay\n");
 		    lvo_name = NULL;




More information about the MPlayer-cvslog mailing list