[MPlayer-dev-eng] [RFC] keep fullscreen mode over aspect, file etc. change if set by user

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Sep 6 22:45:56 CEST 2007


Hello,
On Thu, Jun 28, 2007 at 05:07:44PM +0300, Ivan Kalvachev wrote:
> 2007/6/27, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
[...]
> Anyway, I think we should preserve the FS state, unless the command
> line says something different.
> I don't like the current approach as it requires additional code for
> each vo that wants this kind of behavior, creating huge non-intuitive
> differences among vo's.

So how about this version then?
(the vo_user_x/vo_user_y have no real use yet, I can remove them if you
want, though I think they don't hurt and make my experiments slightly
simpler ;-) ).

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: command.c
===================================================================
--- command.c	(revision 24337)
+++ command.c	(working copy)
@@ -831,8 +831,11 @@
 	    guiGetEvent(guiIEvent, (char *) MP_CMD_GUI_FULLSCREEN);
 	else
 #endif
-	if (vo_config_count)
+	if (vo_config_count) {
 	    mpctx->video_out->control(VOCTRL_FULLSCREEN, 0);
+	    vo_user_override |= VO_USER_OVERRIDE_FS;
+	    vo_user_fs = vo_fs;
+	}
 	return M_PROPERTY_OK;
     default:
 	return m_property_flag(prop, action, arg, &vo_fs);
Index: libvo/video_out.c
===================================================================
--- libvo/video_out.c	(revision 24337)
+++ libvo/video_out.c	(working copy)
@@ -32,6 +32,10 @@
 
 int vo_config_count=0;
 
+int vo_user_override;
+int vo_user_fs;
+int vo_user_x;
+int vo_user_y;
 // requested resolution/bpp:  (-x -y -bpp options)
 int vo_dx=0;
 int vo_dy=0;
@@ -349,6 +353,14 @@
   vo_dheight = d_height;
   }
 
+  if (vo_user_override & VO_USER_OVERRIDE_FS) {
+    if (vo_user_fs) flags |= VOFLAG_FULLSCREEN;
+    else flags &= ~VOFLAG_FULLSCREEN;
+  }
+  if (vo_user_override & VO_USER_OVERRIDE_POS) {
+    vo_dx = vo_user_x;
+    vo_dy = vo_user_y;
+  }
   return vo->config(width, height, d_width, d_height, flags, title, format);
 }
 
Index: libvo/video_out.h
===================================================================
--- libvo/video_out.h	(revision 24337)
+++ libvo/video_out.h	(working copy)
@@ -21,6 +21,13 @@
 #define VO_EVENT_RESIZE 2
 #define VO_EVENT_KEYPRESS 4
 
+#define VO_USER_OVERRIDE_FS  1
+#define VO_USER_OVERRIDE_POS 2
+extern int vo_user_override;
+extern int vo_user_fs;
+extern int vo_user_x;
+extern int vo_user_y;
+
 /* Obsolete: VOCTRL_QUERY_VAA 1 */
 /* does the device support the required format */
 #define VOCTRL_QUERY_FORMAT 2


More information about the MPlayer-dev-eng mailing list