[Mplayer-cvslog] CVS: main/libvo vo_quartz.c,1.31,1.32

Nicolas Plourde CVS syncmail at mplayerhq.hu
Thu Oct 28 16:52:50 CEST 2004


CVS change done by Nicolas Plourde CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv12382/libvo

Modified Files:
	vo_quartz.c 
Log Message:
let you choose fullscreen resolution for slower system

Index: vo_quartz.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_quartz.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- vo_quartz.c	28 Oct 2004 01:15:52 -0000	1.31
+++ vo_quartz.c	28 Oct 2004 14:52:47 -0000	1.32
@@ -87,6 +87,9 @@
 static int device_height;
 static int device_id;
 
+static short fs_res_x=0;
+static short fs_res_y=0;
+
 static WindowRef theWindow = NULL;
 static WindowGroupRef winGroup = NULL;
 static CGContextRef context;
@@ -928,6 +931,13 @@
 				parse_pos = &parse_pos[10];
                 device_id = strtol(parse_pos, &parse_pos, 0);
             }
+            if (strncmp (parse_pos, "fs_res=", 7) == 0)
+            {
+				parse_pos = &parse_pos[7];
+				fs_res_x = strtol(parse_pos, &parse_pos, 0);
+				parse_pos = &parse_pos[1];
+				fs_res_y = strtol(parse_pos, &parse_pos, 0);
+            }
             if (parse_pos[0] == ':') parse_pos = &parse_pos[1];
             else if (parse_pos[0]) parse_err = 1;
         }
@@ -1135,6 +1145,8 @@
 
 void window_ontop()
 {
+	if(!vo_quartz_fs)
+	{
 	//Cycle between level
 	winLevel++;
 	if(winLevel>2)
@@ -1155,11 +1167,16 @@
 		}
 	}
 
+	}
 	SetWindowGroupLevel(winGroup, CGWindowLevelForKey(levelList[winLevel]));
 }
 
 void window_fullscreen()
 {
+	static Ptr restoreState = NULL;
+	RGBColor black={0,0,0};
+	GDHandle deviceHdl;
+
 	//go fullscreen
 	if(vo_fs)
 	{
@@ -1167,6 +1184,18 @@
 		{
 			HideMenuBar();
 			HideCursor();
+			
+			if(fs_res_x != 0 || fs_res_y != 0)
+			{
+				BeginFullScreen( &restoreState, NULL, &fs_res_x, &fs_res_y, NULL, &black, NULL);
+				
+				//Get Main device info///////////////////////////////////////////////////
+				deviceHdl = GetMainDevice();
+				deviceRect = (*deviceHdl)->gdRect;
+        
+				device_width = deviceRect.right;
+				device_height = deviceRect.bottom;
+			}
 		}
 
 		//save old window size
@@ -1183,6 +1212,18 @@
 	}
 	else //go back to windowed mode
 	{
+		if(restoreState != NULL)
+		{
+			EndFullScreen(restoreState, NULL);
+		
+			//Get Main device info///////////////////////////////////////////////////
+			deviceHdl = GetMainDevice();
+			deviceRect = (*deviceHdl)->gdRect;
+        
+			device_width = deviceRect.right;
+			device_height = deviceRect.bottom;
+			restoreState = NULL;
+		}
 		ShowMenuBar();
 
 		//show mouse cursor




More information about the MPlayer-cvslog mailing list