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
This commit is contained in:
pontscho 2002-06-10 18:40:19 +00:00
parent e6f7a4fc4a
commit a3ef885bed
5 changed files with 37 additions and 20 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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 );

View File

@ -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;
}