summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-10 18:40:19 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-10 18:40:19 +0000
commita3ef885bed7889c1b9cd8943dfeca9118199de71 (patch)
treefd7447abeda913088a78ae1bd22f207627c881fc /libvo
parente6f7a4fc4a45e7688e3182ba27d70a8470d8bc34 (diff)
downloadmpv-a3ef885bed7889c1b9cd8943dfeca9118199de71.tar.bz2
mpv-a3ef885bed7889c1b9cd8943dfeca9118199de71.tar.xz
fix panscan support and add Jesper Svennevid's <mplayer@svennevid.net> patch
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6383 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/aspect.c7
-rw-r--r--libvo/mga_common.c21
-rw-r--r--libvo/vo_xmga.c10
-rw-r--r--libvo/vo_xv.c2
-rw-r--r--libvo/vo_xvidix.c17
5 files changed, 37 insertions, 20 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c
index c66e1f2f6c..b32414b272 100644
--- a/libvo/aspect.c
+++ b/libvo/aspect.c
@@ -101,7 +101,12 @@ void panscan_init( void )
void panscan_calc( void )
{
- int vo_panscan_area = (aspdat.scrh-vo_dheight);
+ int fwidth,fheight;
+ int vo_panscan_area;
+
+ aspect(&fwidth,&fheight,A_ZOOM);
+ vo_panscan_area = (aspdat.scrh-fheight);
+
vo_panscan_amount = vo_fs ? vo_panscan : 0;
vo_panscan_x = vo_panscan_area * vo_panscan_amount * aspdat.asp;
vo_panscan_y = vo_panscan_area * vo_panscan_amount;
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index 16ddc390aa..7f656bd769 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -5,7 +5,7 @@
// mga_vid drawing functions
#ifdef VO_XMGA
-static void set_window( int ps ); /* forward declaration to kill warnings */
+static void set_window( void ); /* forward declaration to kill warnings */
#endif
static int mga_next_frame=0;
@@ -272,26 +272,33 @@ static uint32_t control(uint32_t request, void *data, ...)
return query_format(*((uint32_t*)data));
case VOCTRL_GET_IMAGE:
return get_image(data);
+
+#ifndef VO_XMGA
case VOCTRL_FULLSCREEN:
-#ifdef VO_XMGA
- vo_x11_fullscreen();
-#else
mga_fullscreen();
-#endif
return VO_TRUE;
+#endif
+
#if defined( VO_XMGA ) && defined( HAVE_NEW_GUI )
case VOCTRL_GUISUPPORT:
return VO_TRUE;
#endif
+
#ifdef VO_XMGA
case VOCTRL_GET_PANSCAN:
if ( !inited || !vo_fs ) return VO_FALSE;
return VO_TRUE;
+ case VOCTRL_FULLSCREEN:
+ vo_x11_fullscreen();
+ vo_panscan_amount=0;
+ /* indended, fallthrough to update panscan on fullscreen/windowed switch */
case VOCTRL_SET_PANSCAN:
- if ( vo_fs && ( vo_panscan != vo_panscan_amount ) )
+ if ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) // || ( !vo_fs && vo_panscan_amount ) )
{
+ int old_y = vo_panscan_y;
panscan_calc();
- set_window( 1 );
+// if ( old_y != vo_panscan_y )
+ set_window();
}
return VO_TRUE;
#endif
diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c
index 9a1f63e3ee..3a90ed233a 100644
--- a/libvo/vo_xmga.c
+++ b/libvo/vo_xmga.c
@@ -105,7 +105,7 @@ static void mDrawColorKey( void )
XFlush( mDisplay );
}
-static void set_window( int ps ){
+static void set_window( void ){
if ( WinID )
{
@@ -163,7 +163,7 @@ static void set_window( int ps ){
mga_vid_config.y_org=drwcY;
mga_vid_config.dest_width=drwWidth;
mga_vid_config.dest_height=drwHeight;
- if ( ps )
+ if ( vo_panscan > 0.0f && vo_fs )
{
drwX-=vo_panscan_x>>1;
drwY-=vo_panscan_y>>1;
@@ -183,7 +183,7 @@ static void check_events(void)
{
int e=vo_x11_check_events(mDisplay);
if ( !(e&VO_EVENT_RESIZE) && !(e&VO_EVENT_EXPOSE) ) return;
- set_window( 0 );
+ set_window();
mDrawColorKey();
if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) ) mp_msg(MSGT_VO,MSGL_WARN,"Error in mga_vid_config ioctl (wrong mga_vid.o version?)" );
}
@@ -323,8 +323,10 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
}
if ( ( flags&1 )&&( !WinID ) ) { vo_dx=0; vo_dy=0; vo_dwidth=vo_screenwidth; vo_dheight=vo_screenheight; vo_fs=1; }
+
+ panscan_calc();
- set_window( 0 );
+ set_window();
mga_vid_config.src_width=width;
mga_vid_config.src_height=height;
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 3f72206042..b91831e37c 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -499,6 +499,8 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
vo_dheight=(vo_dheight > vo_screenheight?vo_screenheight:vo_dheight);
mp_msg(MSGT_VO,MSGL_V, "[xv-fs] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
}
+
+ panscan_calc();
mp_msg(MSGT_VO,MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c
index af6ab734d9..affb66a5d3 100644
--- a/libvo/vo_xvidix.c
+++ b/libvo/vo_xvidix.c
@@ -74,7 +74,7 @@ static uint32_t window_width, window_height;
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
drwDepth, drwcX, drwcY, dwidth, dheight;
-static void set_window(int force_update,const vo_tune_info_t *info, int ps)
+static void set_window(int force_update,const vo_tune_info_t *info)
{
Window mRoot;
if ( WinID )
@@ -137,7 +137,7 @@ static void set_window(int force_update,const vo_tune_info_t *info, int ps)
}
#endif
- if ( ps )
+ if ( vo_panscan > 0.0f && vo_fs )
{
drwcX-=vo_panscan_x >> 1;
drwcY-=vo_panscan_y >> 1;
@@ -363,12 +363,14 @@ else
vidix_grkey_set(&gr_key);
}
- set_window(1,info,0);
+ set_window(1,info);
if(info) memcpy(&vtune,info,sizeof(vo_tune_info_t));
else memset(&vtune,0,sizeof(vo_tune_info_t));
XFlush(mDisplay);
XSync(mDisplay, False);
+ panscan_calc();
+
saver_off(mDisplay); /* turning off screen saver */
vo_config_count++;
@@ -386,7 +388,7 @@ static void check_events(void)
const int event = vo_x11_check_events(mDisplay);
if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE))
- set_window(0,&vtune,0);
+ set_window(0,&vtune);
return;
}
@@ -463,17 +465,16 @@ static uint32_t control(uint32_t request, void *data, ...)
return query_format(*((uint32_t*)data));
case VOCTRL_GUISUPPORT:
return VO_TRUE;
- case VOCTRL_FULLSCREEN:
- vo_x11_fullscreen();
- return VO_TRUE;
case VOCTRL_GET_PANSCAN:
if ( !vo_config_count || !vo_fs ) return VO_FALSE;
return VO_TRUE;
+ case VOCTRL_FULLSCREEN:
+ vo_x11_fullscreen();
case VOCTRL_SET_PANSCAN:
if ( vo_fs && ( vo_panscan != vo_panscan_amount ) )
{
panscan_calc();
- set_window( 0,&vtune,1 );
+ set_window( 0,&vtune );
}
return VO_TRUE;
}