mirror of https://github.com/mpv-player/mpv
fix xmga fs, resize to movie size and mouse auto hide + dga
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5956 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4bf6dad4cf
commit
b6004b1b7c
|
@ -96,12 +96,10 @@ void guiGetEvent( int type,char * arg )
|
||||||
wsPostRedisplay( &appMPlayer.subWindow );
|
wsPostRedisplay( &appMPlayer.subWindow );
|
||||||
break;
|
break;
|
||||||
case guiSetShVideo:
|
case guiSetShVideo:
|
||||||
if ( arg )
|
|
||||||
{
|
{
|
||||||
tmp_sh_video_t * sh_video = (tmp_sh_video_t *)arg;
|
|
||||||
mplResizeToMovieSize( vo_dwidth,vo_dheight );
|
mplResizeToMovieSize( vo_dwidth,vo_dheight );
|
||||||
guiIntfStruct.MovieWidth=sh_video->disp_w;
|
guiIntfStruct.MovieWidth=vo_dwidth;
|
||||||
guiIntfStruct.MovieHeight=sh_video->disp_h;
|
guiIntfStruct.MovieHeight=vo_dwidth;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef USE_DVDREAD
|
#ifdef USE_DVDREAD
|
||||||
|
|
|
@ -242,7 +242,7 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
vo_mouse_autohide=1;
|
||||||
if (!title)
|
if (!title)
|
||||||
title = strdup("MPlayer X11 (XImage/Shm) render");
|
title = strdup("MPlayer X11 (XImage/Shm) render");
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,10 @@ static unsigned int timer=0;
|
||||||
static unsigned int timerd=0;
|
static unsigned int timerd=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_NEW_GUI
|
||||||
|
#include "../Gui/interface.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static vo_info_t vo_info =
|
static vo_info_t vo_info =
|
||||||
{
|
{
|
||||||
"X11 (Matrox G200/G4x0/G550 overlay in window using /dev/mga_vid)",
|
"X11 (Matrox G200/G4x0/G550 overlay in window using /dev/mga_vid)",
|
||||||
|
@ -67,7 +71,6 @@ static vo_info_t vo_info =
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
//static Display * mDisplay;
|
|
||||||
static XGCValues wGCV;
|
static XGCValues wGCV;
|
||||||
|
|
||||||
static XImage * myximage;
|
static XImage * myximage;
|
||||||
|
@ -187,17 +190,9 @@ static int inited=0;
|
||||||
|
|
||||||
static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t* info)
|
static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t* info)
|
||||||
{
|
{
|
||||||
char * frame_mem;
|
|
||||||
// uint32_t frame_size;
|
|
||||||
// int mScreen;
|
|
||||||
unsigned int fg, bg;
|
|
||||||
char * mTitle=(title == NULL) ? "XMGA render" : title;
|
char * mTitle=(title == NULL) ? "XMGA render" : title;
|
||||||
char * name=":0.0";
|
|
||||||
XSizeHints hint;
|
|
||||||
XVisualInfo vinfo;
|
XVisualInfo vinfo;
|
||||||
XEvent xev;
|
|
||||||
|
|
||||||
XGCValues xgcv;
|
|
||||||
unsigned long xswamask;
|
unsigned long xswamask;
|
||||||
|
|
||||||
width+=width&1;
|
width+=width&1;
|
||||||
|
@ -241,6 +236,7 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
|
||||||
vo_dwidth=d_width; vo_dheight=d_height;
|
vo_dwidth=d_width; vo_dheight=d_height;
|
||||||
if ( vo_fs )
|
if ( vo_fs )
|
||||||
{ vo_old_width=d_width; vo_old_height=d_height; }
|
{ vo_old_width=d_width; vo_old_height=d_height; }
|
||||||
|
vo_mouse_autohide=1;
|
||||||
|
|
||||||
switch ( vo_depthonscreen )
|
switch ( vo_depthonscreen )
|
||||||
{
|
{
|
||||||
|
@ -263,10 +259,9 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
|
||||||
vo_dwidth=vo_screenwidth;
|
vo_dwidth=vo_screenwidth;
|
||||||
vo_dheight=vo_screenheight;
|
vo_dheight=vo_screenheight;
|
||||||
#ifdef X11_FULLSCREEN
|
#ifdef X11_FULLSCREEN
|
||||||
aspect(&vo_dwidth,&vo_dheight,A_ZOOM);
|
aspect(&dwidth,&dheight,A_ZOOM);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
dwidth=vo_dwidth; dheight=vo_dheight;
|
|
||||||
|
|
||||||
XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs );
|
XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs );
|
||||||
mDepth=attribs.depth;
|
mDepth=attribs.depth;
|
||||||
|
@ -304,7 +299,7 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
|
||||||
#endif
|
#endif
|
||||||
vo_gc=XCreateGC( mDisplay,vo_window,GCForeground,&wGCV );
|
vo_gc=XCreateGC( mDisplay,vo_window,GCForeground,&wGCV );
|
||||||
#ifdef HAVE_NEW_GUI
|
#ifdef HAVE_NEW_GUI
|
||||||
}
|
} else guiGetEvent( guiSetShVideo,0 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_window();
|
set_window();
|
||||||
|
|
|
@ -41,6 +41,10 @@ LIBVO_EXTERN(xv)
|
||||||
|
|
||||||
#include "../postproc/rgb2rgb.h"
|
#include "../postproc/rgb2rgb.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_NEW_GUI
|
||||||
|
#include "../Gui/interface.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static vo_info_t vo_info =
|
static vo_info_t vo_info =
|
||||||
{
|
{
|
||||||
"X11/Xv",
|
"X11/Xv",
|
||||||
|
@ -330,6 +334,8 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
|
||||||
image_height = height;
|
image_height = height;
|
||||||
image_width = width;
|
image_width = width;
|
||||||
image_format=format;
|
image_format=format;
|
||||||
|
|
||||||
|
vo_mouse_autohide=1;
|
||||||
|
|
||||||
vo_dwidth=d_width; vo_dheight=d_height;
|
vo_dwidth=d_width; vo_dheight=d_height;
|
||||||
vo_fs=flags&1;
|
vo_fs=flags&1;
|
||||||
|
@ -446,7 +452,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NEW_GUI
|
#ifdef HAVE_NEW_GUI
|
||||||
}
|
} else guiGetEvent( guiSetShVideo,0 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mp_msg(MSGT_VO,MSGL_V, "using Xvideo port %d for hw scaling\n",xv_port );
|
mp_msg(MSGT_VO,MSGL_V, "using Xvideo port %d for hw scaling\n",xv_port );
|
||||||
|
|
|
@ -60,6 +60,7 @@ int mLocalDisplay;
|
||||||
|
|
||||||
/* output window id */
|
/* output window id */
|
||||||
int WinID=-1;
|
int WinID=-1;
|
||||||
|
int vo_mouse_autohide = 0;
|
||||||
|
|
||||||
#ifdef HAVE_XINERAMA
|
#ifdef HAVE_XINERAMA
|
||||||
int xinerama_screen = 0;
|
int xinerama_screen = 0;
|
||||||
|
@ -90,7 +91,10 @@ void vo_hidecursor ( Display *disp , Window win )
|
||||||
}
|
}
|
||||||
|
|
||||||
void vo_showcursor( Display *disp, Window win )
|
void vo_showcursor( Display *disp, Window win )
|
||||||
{ XDefineCursor( disp,win,0 ); }
|
{
|
||||||
|
if ( WinID==0 ) return;
|
||||||
|
XDefineCursor( disp,win,0 );
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef SCAN_VISUALS
|
#ifdef SCAN_VISUALS
|
||||||
/*
|
/*
|
||||||
|
@ -384,6 +388,9 @@ static Atom vo_MotifHints = None;
|
||||||
void vo_x11_decoration( Display * vo_Display,Window w,int d )
|
void vo_x11_decoration( Display * vo_Display,Window w,int d )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ( !WinID ) return;
|
||||||
|
|
||||||
|
#if 0
|
||||||
if(vo_fsmode&1){
|
if(vo_fsmode&1){
|
||||||
XSetWindowAttributes attr;
|
XSetWindowAttributes attr;
|
||||||
attr.override_redirect = True;
|
attr.override_redirect = True;
|
||||||
|
@ -394,6 +401,7 @@ void vo_x11_decoration( Display * vo_Display,Window w,int d )
|
||||||
if(vo_fsmode&8){
|
if(vo_fsmode&8){
|
||||||
XSetTransientForHint (vo_Display, w, RootWindow(vo_Display,mScreen));
|
XSetTransientForHint (vo_Display, w, RootWindow(vo_Display,mScreen));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
|
vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
|
||||||
if ( vo_MotifHints != None )
|
if ( vo_MotifHints != None )
|
||||||
|
@ -464,7 +472,7 @@ int vo_x11_check_events(Display *mydisplay){
|
||||||
|
|
||||||
// unsigned long vo_KeyTable[512];
|
// unsigned long vo_KeyTable[512];
|
||||||
|
|
||||||
if ( --vo_mouse_counter == 0 ) vo_hidecursor( mydisplay,vo_window );
|
if ( ( vo_mouse_autohide )&&( --vo_mouse_counter == 0 ) ) vo_hidecursor( mydisplay,vo_window );
|
||||||
|
|
||||||
while ( XPending( mydisplay ) )
|
while ( XPending( mydisplay ) )
|
||||||
{
|
{
|
||||||
|
@ -513,11 +521,11 @@ int vo_x11_check_events(Display *mydisplay){
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const;
|
if ( vo_mouse_autohide ) { vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const; }
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_NEW_INPUT
|
#ifdef HAVE_NEW_INPUT
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const;
|
if ( vo_mouse_autohide ) { vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const; }
|
||||||
// Ignore mouse whell press event
|
// Ignore mouse whell press event
|
||||||
if(Event.xbutton.button > 3) {
|
if(Event.xbutton.button > 3) {
|
||||||
mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1);
|
mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1);
|
||||||
|
@ -530,7 +538,7 @@ int vo_x11_check_events(Display *mydisplay){
|
||||||
mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN);
|
mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN);
|
||||||
break;
|
break;
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const;
|
if ( vo_mouse_autohide ) { vo_showcursor( mydisplay,vo_window ); vo_mouse_counter=vo_mouse_timer_const; }
|
||||||
#ifdef HAVE_NEW_GUI
|
#ifdef HAVE_NEW_GUI
|
||||||
// Ignor mouse button 1 - 3 under gui
|
// Ignor mouse button 1 - 3 under gui
|
||||||
if ( use_gui && ( Event.xbutton.button >= 1 )&&( Event.xbutton.button <= 3 ) ) break;
|
if ( use_gui && ( Event.xbutton.button >= 1 )&&( Event.xbutton.button <= 3 ) ) break;
|
||||||
|
@ -591,7 +599,7 @@ void vo_x11_fullscreen( void )
|
||||||
vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
|
vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
|
||||||
XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
|
XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
|
||||||
XMapRaised( mDisplay,vo_window );
|
XMapRaised( mDisplay,vo_window );
|
||||||
|
|
||||||
XRaiseWindow( mDisplay,vo_window );
|
XRaiseWindow( mDisplay,vo_window );
|
||||||
XFlush( mDisplay );
|
XFlush( mDisplay );
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ extern int mLocalDisplay;
|
||||||
extern int WinID;
|
extern int WinID;
|
||||||
|
|
||||||
extern int vo_mouse_timer_const;
|
extern int vo_mouse_timer_const;
|
||||||
|
extern int vo_mouse_autohide;
|
||||||
|
|
||||||
int vo_init( void );
|
int vo_init( void );
|
||||||
int vo_hidecursor ( Display* , Window );
|
int vo_hidecursor ( Display* , Window );
|
||||||
|
|
|
@ -1319,7 +1319,6 @@ fflush(stdout);
|
||||||
#ifdef HAVE_NEW_GUI
|
#ifdef HAVE_NEW_GUI
|
||||||
if ( use_gui )
|
if ( use_gui )
|
||||||
{
|
{
|
||||||
guiGetEvent( guiSetShVideo,(char *)sh_video );
|
|
||||||
guiGetEvent( guiSetFileName,filename );
|
guiGetEvent( guiSetFileName,filename );
|
||||||
guiIntfStruct.StreamType=stream->type;
|
guiIntfStruct.StreamType=stream->type;
|
||||||
if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
|
if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
|
||||||
|
|
Loading…
Reference in New Issue