[Mplayer-cvslog] CVS: main/libvo mga_common.c,1.31,1.32 vo_mga.c,1.30,1.31

Richard Felker CVS rfelker at mplayerhq.hu
Sun May 5 20:58:44 CEST 2002


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

Modified Files:
	mga_common.c vo_mga.c 
Log Message:
fullscreen toggle for vo_mga


Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- mga_common.c	13 Apr 2002 19:14:33 -0000	1.31
+++ mga_common.c	5 May 2002 18:58:42 -0000	1.32
@@ -233,6 +233,32 @@
   vaa->get_video_eq = mga_get_video_eq;
   vaa->set_video_eq = mga_set_video_eq;
 }
+
+static void mga_fullscreen()
+{
+	uint32_t w,h;
+	if ( !vo_fs ) {
+		vo_fs=VO_TRUE;
+		w=vo_screenwidth; h=vo_screenheight;
+		aspect(&w,&h,A_ZOOM);
+	} else {
+		vo_fs=VO_FALSE;
+		w=vo_dwidth; h=vo_dheight;
+		aspect(&w,&h,A_NOZOOM);
+	}
+	mga_vid_config.dest_width = w;
+	mga_vid_config.dest_height= h;
+	if (vo_screenwidth && vo_screenheight) {
+		mga_vid_config.x_org=(vo_screenwidth-w)/2;
+		mga_vid_config.y_org=(vo_screenheight-h)/2;
+	} else {
+		mga_vid_config.x_org= 0;
+		mga_vid_config.y_org= 0;
+	}
+	if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) )
+		printf( "Error in mga_vid_config ioctl (wrong mga_vid.o version?)" );
+}
+
 static uint32_t control(uint32_t request, void *data, ...)
 {
   switch (request) {
@@ -243,11 +269,13 @@
     return query_format(*((uint32_t*)data));
   case VOCTRL_GET_IMAGE:
     return get_image(data);
-#ifdef VO_XMGA
   case VOCTRL_FULLSCREEN:
+#ifdef VO_XMGA
     vo_x11_fullscreen();
-    return VO_TRUE;
+#else
+    mga_fullscreen();
 #endif
+    return VO_TRUE;
   }
   return VO_NOTIMPL;
 }

Index: vo_mga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mga.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- vo_mga.c	31 Mar 2002 20:45:31 -0000	1.30
+++ vo_mga.c	5 May 2002 18:58:42 -0000	1.31
@@ -84,10 +84,13 @@
 		aspect_save_prescale(d_width,d_height);
 		aspect_save_screenres(vo_screenwidth,vo_screenheight);
 	
-		if(fullscreen&0x01) /* -fs */
+		if(fullscreen&0x01) { /* -fs */
 			aspect(&d_width,&d_height,A_ZOOM);
-		else
+			vo_fs = VO_TRUE;
+		} else {
 			aspect(&d_width,&d_height,A_NOZOOM);
+			vo_fs = VO_FALSE;
+		}
 		printf("vo_mga aspect(): resized to %dx%d\n",d_width,d_height);
 	}
 




More information about the MPlayer-cvslog mailing list