summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authornplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-28 14:52:47 +0000
committernplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-28 14:52:47 +0000
commitcbe6825c91731e0351e130f43ec0e02c51df9adb (patch)
tree82784fe83d81aef464033301847b8b3bc93b57ee /libvo
parent5b0d96c6b48482bc434d735b35089bbfc8751742 (diff)
downloadmpv-cbe6825c91731e0351e130f43ec0e02c51df9adb.tar.bz2
mpv-cbe6825c91731e0351e130f43ec0e02c51df9adb.tar.xz
let you choose fullscreen resolution for slower system
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13789 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_quartz.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c
index bdf323a5a4..b3a4d57865 100644
--- a/libvo/vo_quartz.c
+++ b/libvo/vo_quartz.c
@@ -87,6 +87,9 @@ static int device_width;
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 @@ static uint32_t preinit(const char *arg)
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_resized()
void window_ontop()
{
+ if(!vo_quartz_fs)
+ {
//Cycle between level
winLevel++;
if(winLevel>2)
@@ -1155,11 +1167,16 @@ void window_ontop()
}
}
+ }
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 @@ void window_fullscreen()
{
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 @@ void window_fullscreen()
}
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