diff options
author | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-05 18:58:42 +0000 |
---|---|---|
committer | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-05 18:58:42 +0000 |
commit | c1a516894c67d2f55b34a806d43f534f92adb75d (patch) | |
tree | eb2c79acc4a5c2e8612ff497239ac5b6f20ba752 /libvo/mga_common.c | |
parent | 8c9b41e72a2dea564512c31e15f5f72c663fd49c (diff) | |
download | mpv-c1a516894c67d2f55b34a806d43f534f92adb75d.tar.bz2 mpv-c1a516894c67d2f55b34a806d43f534f92adb75d.tar.xz |
fullscreen toggle for vo_mga
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5988 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/mga_common.c')
-rw-r--r-- | libvo/mga_common.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c index 91691984e6..57d59f24f3 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -233,6 +233,32 @@ static void query_vaa(vo_vaa_t *vaa) 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 @@ static uint32_t control(uint32_t request, void *data, ...) 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; } |