[Mplayer-cvslog] CVS: main/libvo video_out.c,1.78,1.79 vo_cvidix.c,1.3,1.4 vo_fbdev.c,1.85,1.86 vo_svga.c,1.71,1.72 vo_vesa.c,1.95,1.96 vo_xvidix.c,1.62,1.63

Alex Beregszaszi alex at mplayerhq.hu
Fri Oct 17 11:08:42 CEST 2003


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

Modified Files:
	video_out.c vo_cvidix.c vo_fbdev.c vo_svga.c vo_vesa.c 
	vo_xvidix.c 
Log Message:
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
by Jake Page <jake at CS.Stanford.EDU>


Index: video_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- video_out.c	5 Oct 2003 15:33:00 -0000	1.78
+++ video_out.c	17 Oct 2003 09:08:37 -0000	1.79
@@ -48,6 +48,7 @@
 int vo_directrendering=0;
 
 int vo_colorkey = 0x0000ff00; // default colorkey is green
+			      // (0xff000000 means that colorkey has been disabled)
 
 //
 // Externally visible list of all vo drivers

Index: vo_cvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_cvidix.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vo_cvidix.c	5 Oct 2003 15:39:00 -0000	1.3
+++ vo_cvidix.c	17 Oct 2003 09:08:37 -0000	1.4
@@ -48,8 +48,15 @@
   if(vidix_grkey_support()){
     vidix_grkey_get(&gr_key);
     gr_key.key_op = KEYS_PUT;
-    gr_key.ckey.op = CKEY_TRUE;
-    gr_key.ckey.red = gr_key.ckey.green = gr_key.ckey.blue = 0;
+    if (vo_colorkey != 0xff000000)
+    {
+	gr_key.ckey.op = CKEY_TRUE;
+	gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16;
+	gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8;
+	gr_key.ckey.blue = vo_colorkey & 0x000000FF;
+    }
+    else
+	gr_key.ckey.op = CKEY_FALSE;
     vidix_grkey_set(&gr_key);
   }         
   return 0;

Index: vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- vo_fbdev.c	8 Oct 2003 10:58:44 -0000	1.85
+++ vo_fbdev.c	17 Oct 2003 09:08:37 -0000	1.86
@@ -42,6 +42,7 @@
 #ifdef CONFIG_VIDIX
 /* Name of VIDIX driver */
 static const char *vidix_name = NULL;
+static vidix_grkey_t gr_key;
 #endif
 static signed int pre_init_err = -2;
 /******************************
@@ -976,6 +977,21 @@
 		}
 		else mp_msg(MSGT_VO, MSGL_V, "Using VIDIX\n");
 		vidix_start();
+		if (vidix_grkey_support())
+		{
+		    vidix_grkey_get(&gr_key);
+		    gr_key.key_op = KEYS_PUT;
+		    if (vo_colorkey != 0xff000000)
+		    {
+			gr_key.ckey.op = CKEY_TRUE;
+			gr_key.ckey.red = (vo_colorkey & 0x00ff0000) >> 16;
+			gr_key.ckey.green = (vo_colorkey & 0x0000ff00) >> 8;
+			gr_key.ckey.blue = vo_colorkey & 0x000000ff;
+		    }
+		    else
+			gr_key.ckey.op = CKEY_FALSE;
+		    vidix_grkey_set(&gr_key);
+		}
 	}
 	else
 #endif

Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- vo_svga.c	4 Oct 2003 17:29:04 -0000	1.71
+++ vo_svga.c	17 Oct 2003 09:08:37 -0000	1.72
@@ -105,6 +105,7 @@
 
 #ifdef CONFIG_VIDIX
 static char vidix_name[32] = "";
+static vidix_grkey_t gr_key;
 #endif
 
 LIBVO_EXTERN(svga)
@@ -526,6 +527,19 @@
     printf("vo_svga: Using VIDIX. w=%i h=%i  mw=%i mh=%i\n",width,height,
            modeinfo->width,modeinfo->height);
     vidix_start();
+    /*set colorkey*/       
+    if(vidix_grkey_support()){
+      vidix_grkey_get(&gr_key);
+      gr_key.key_op = KEYS_PUT;
+      if (vo_colorkey != 0xFF000000) {
+	gr_key.ckey.op = CKEY_TRUE;
+	gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16;
+	gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8;
+	gr_key.ckey.blue = vo_colorkey & 0x000000FF;
+      } else
+	gr_key.ckey.op = CKEY_FALSE;
+      vidix_grkey_set(&gr_key);
+    }         
   }
 #endif    
 

Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- vo_vesa.c	31 Aug 2003 18:33:02 -0000	1.95
+++ vo_vesa.c	17 Oct 2003 09:08:37 -0000	1.96
@@ -120,6 +120,7 @@
 #ifdef CONFIG_VIDIX
 static const char *vidix_name = NULL;
 static int vidix_opened = 0;
+static vidix_grkey_t gr_key;
 #endif
 
 #define HAS_DGA()  (win.idx == -1)
@@ -958,6 +959,22 @@
 		  }
 		  else printf("vo_vesa: Using VIDIX\n");
 		  vidix_start();
+
+		  /* set colorkey */       
+		  if (vidix_grkey_support())
+		  {
+		    vidix_grkey_get(&gr_key);
+		    gr_key.key_op = KEYS_PUT;
+		    if (vo_colorkey != 0xFF000000)
+		    {
+			gr_key.ckey.op = CKEY_TRUE;
+			gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16;
+			gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8;
+			gr_key.ckey.blue = vo_colorkey & 0x000000FF;
+		    } else
+			gr_key.ckey.op = CKEY_FALSE;
+		    vidix_grkey_set(&gr_key);
+		  }         
 		  vidix_opened = 1;
 		}
 #endif

Index: vo_xvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvidix.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- vo_xvidix.c	3 Oct 2003 18:13:45 -0000	1.62
+++ vo_xvidix.c	17 Oct 2003 09:08:37 -0000	1.63
@@ -197,11 +197,14 @@
     /* mDrawColorKey: */
 
     /* fill drawable with specified color */
+    if (vo_colorkey != 0xff000000)
+    {
     XSetBackground(mDisplay, vo_gc, 0L);
     XClearWindow( mDisplay,vo_window );
     XSetForeground(mDisplay, vo_gc, colorkey);
     XFillRectangle(mDisplay, vo_window, vo_gc, drwX, drwY, drwWidth,
 	(vo_fs ? drwHeight - 1 : drwHeight));
+    }
     /* flush, update drawable */
     XFlush(mDisplay);
 
@@ -346,10 +349,15 @@
     {
 	vidix_grkey_get(&gr_key);
 	gr_key.key_op = KEYS_PUT;
-	gr_key.ckey.op = CKEY_TRUE;
-	gr_key.ckey.red = r;
-	gr_key.ckey.green = g;
-	gr_key.ckey.blue = b;
+	if (vo_colorkey != 0xff000000)
+	{
+	    gr_key.ckey.op = CKEY_TRUE;
+	    gr_key.ckey.red = r;
+	    gr_key.ckey.green = g;
+	    gr_key.ckey.blue = b;
+	}
+	else
+	    gr_key.ckey.op = CKEY_FALSE;
 	vidix_grkey_set(&gr_key);
     }
 



More information about the MPlayer-cvslog mailing list